What happens to cash when you buy a company?

Hey guys,

Would really appreciate some help with a probably really basic accounting question.

When you purchase a company, let's say through an LBO.... what happens to the cash of the target? Does the seller take it all with them? So, once you own the company, there's 0 cash left?

The reason I guess I am a bit confused is because you subtract cash from the EV formula....

Thanks so much guys. I know this is basic - but for some reason I'm having some trouble here.