I understand that for a switch to learn a MAC address, if host A wanted to send data to Host B the switch learns host A MAC and places it in the MAC table. If it doesn't know where the MAC (for Host B) is then it will flood the ports. Host B then creates a frame and sends it to Host, allowing the switch to learn the MAC of Host B.
My understanding of ARP is that if Host A wants to send data to Host D (separate network) then Host A will need to learn the default gateway MAC, so Host A sends a ARP request for the gateway, the switch then receive the frame, the switch learn the MAC of Host A, etc.
The problem I seem to have is that I seem to be getting confused between MAC table and ARP. Is ARP always used? In the first example there was no mention of ARP, so I've gotten confused between the terms and when they are used.