I'm doing a ping from a station to another connected on the same access point. Given the fact that they are both on Wi-fi interface, how can access point know where to forward a packet?
That is what MAC addresses are used for. A bridge (switch, WAP, etc.) maintains a MAC address table. The table tells the device the interface where it has last ween the MAC address as a source address, and it will forward any frames with that destination MAC address to the same interface where it last saw it as the source MAC address.