Cercanías is the commuter rail line. When you buy certain train tickets on Renfe, they throw in a free Cercanías ticket in case you need to make your way on public transportation to the train station. If you are arriving in Madrid on the plane, that means you get a free ride from the airport to the train station. Cercanías is a terrific service, it leaves every 15 minutes from the Madrid airport and gets you to Atocha in about a half hour.
The Cercanías trains run only to T4 (terminal 4) at the Madrid airport. The other terminals are about a 15 minute bus ride away. It’s easy to know which terminal you will arrive in — if you fly on Iberia or a One World Alliance partner (American, BA, etc), you will arrive in T4. All other airlines arrive at the old airport, T1-T3.
Good luck.