All to save the world from the demon HIRANYAKSHA, who was dragging it down into the primordial ocean.
VARAHA dived in after it and flipped it out with his tusks so swiftly that not a drop of water had time to harm anything. He then gave the demon a total tusking.
VISHNU was then free to stop making a pig of himself. We are told that he got the original idea from BRAHMA himself who had used the boar thing to bring the world up from primordial ocean in the first place, except that he had to dry it out and stock it with livestock.