How will a foreclosure work with a second mortgage?

Missi B asked: Mortgage company put us into foreclosure on the 1st because of being behind in the escrow but there is a second on the house, with the same company. How does that work?