A fridge circulates its internal air through a refrigeration process that uses a compressor to compress a special gas that gets really cold under pressure.
The gas is pumped through a latticework of fine tubes like a mini radiator and the air passes through that latticework to make it cold.
The cold air is then circulated inside the fridge to keep its contents nice and cold.
If you ever pulled your fridge out and looked around the back at the base, you'd see the motor and some of the pipes that are doing the work.
You'd also notice a lot of hot air coming off the motor, which is a normal by-product of the work the compressor does.
Of course that hot air doesn't get let into the interior of the fridge because that would be pretty stupid!
An air conditioner does the same thing pretty much, just on a larger scale. Instead of cooling a small, enclosed space like your fridge, it has to cope with the much larger area of the room you're occupying.
Luckily, it is designed for that job and does a pretty good job of it too.
You probably noticed your AC is hooked up to a box on the outside of your home that has a fan in and is busy pumping out a lot of hot air.
That hot air is coming from the compressor in the AC inside, just like the fridge.