What you have here is basically an Ethernet/IP network (wifi is not ethernet, but is similar enough). Layer 2 is Ethernet, and layer 3 is IP.
On the wire, there are Ethernet packets with ethernet addresses (MACs) containing IP packets with IP addresses. Ethernet is typically used within a single subnet (e.g. 192.168.0.*) and multiple ethernet sub-networks are joined via routers into bigger IP networks.
When your computer sends an IP packet, it look into its routing table to choose where to send it. If it is in the local network (route without gateway), it will find the Ethernet (MAC) address of the destination (via ARP). The IP packet with the source IP address and destination IP address will be put in an Ethernet frame with source and destination Ethernet addresses of your computer and the destination.
If the routing table specifies a route with a gateway (either default or a subnet route), it will look for the Ethernet address of the gateway (not destination) and once again, the IP packet with its source and destination IPs will be sent inside an Ethernet frame with source Ethernet IP of your computer and destination Ethernet address not of destination computer, but of the gateway. The gateway will receive the Ethernet frame on one of its interfaces, look at the IPs in the IP packet and send it off on another interface, in a method similar to your computer.
A packet that is routed by a pure router will not have its IP information chaged. The router will select a route for the packet in a way similar to your computer, put it inside a new Ethernet frame, with source Ethernet address of the outgoing interface of the gateway and destination Ethernet address of either the destination, or another gateway depending on the route and send it off.
The reason to have ethernet addresses is because ethernet is not a point-to-point wire, but a network of elements joined together by switches, the simpler router equivalent of ethernet layer.
Now, not all networks are ethernet. Your internet uplink is probably not ethernet, and even wifi is not ethernet, but typical simple wifi acts mostly like ethernet, has ethernet-complatible addresses and it can even be bridged in a ethernet-wifi layer 2 hybrid network, e.g. when you use "dumb APs".
Also, your typical home router is not a router, but typically a switch (on the LAN side) mini-computer-like quasi-router that aside from trivial routing also does NAT rewriting of source/destination IP addresses and ports on packets it forwards between LAN and WAN.
It should be apparent by now, that when pinging, you will not see a packet with its destination IP set to that of the gateway, but if you look at ethernet addresses, it should be that of the gateway.