There are a few different ways that the engine can affect the AC in your car. The most common way is by putting a load on the alternator. When you turn on the AC, it puts a strain on the alternator which in turn can make the engine work harder. This can lead to decreased fuel economy and increased engine wear. Additionally, if your AC compressor is belt-driven, it will put a load on the engine which can also lead to decreased fuel economy and increased engine wear.
Another way that the engine can affect the AC is through something called compressor clutch cycling. This happens when the compressor turns on and off rapidly, and it puts a strain on both the compressor and the engine. Compressor clutch cycling can decrease fuel economy and increase wear on both the compressor and the engine.
Finally, if your car has an older engine with carburetion (instead of fuel injection), running the AC can cause vapor lock. Vapor lock occurs when fuel vaporizes in the carburetor instead of igniting, and it can cause stalling or hesitations while driving. While vapor lock is usually not harmful to your car, it can be annoying and inconvenient.