What does the vacuum pump do in an engine?

You must have a diesel. The vacuum pump is what gives you POWER BRAKES and on the newer engines it also makes the power steering work.

Only a gas engine makes vacuum. A diesel engine does not make vacuum, so they install a vacuum pump.