The hypertrophied pylorus is both thicker and longer than usual and blocks the contents of the stomach from exiting into the duodenum (the first part of the intestine); the hypertrophy may become bad enough to block the gastric (stomach) outlet completely. Since what goes in must come out, and the stomach produces some fluid itself (including the acid it uses to start digestion), eventually a child with pyloric stenosis will vomit to empty the stomach.
Once the gastric outlet is blocked (stenosed), a child will vomit after every feeding. Vomiting is usually forceful, so much so that the vomitus travels a considerable distance (like across the room): this is what we refer to as projectile vomiting. The vomitus includes stomach acid, so the child will lose acid from his body and become too alkaline (acid-base balance is normally carefully regulated by your body); also, he may become dehydrated both from vomiting and from being unable to drink and keep down fluids. Also, the body's mineral balances may be thrown off by the vomiting, including loss of potassium which may result in dangerous changes in how electrically-active tissues (including the heart, other muscles, and the brain and nerves) work; however, changes in potassium may not be severe until after several weeks of vomiting. Some babies with pyloric stenosis require IV fluids for rehydration and to correct mineral abnormalities before they can be treated for the stenosis.
A baby with pyloric stenosis will still be hungry, even immediately after throwing up. He may lose weight, especially if he has been vomiting for several weeks. The classic sign we look for when examining a child who might have pyloric stenosis is an "olive" -- a round mass, usually found above and to the right of the belly button, which is the pylorus swollen and in spasm. This is not easy to find, though -- I've felt one in my entire career -- but is a bit easier to feel right after the baby vomits, since the pylorus swells just about when vomiting starts.
As the baby grows, pyloric obstruction becomes less severe. However, the quickest treatment is surgical: the surgeon cuts through the pylorus on one side, from end to end, leaving the entire thickness of the mucous membrane that walls the inside of the pylorus intact. This procedure, known as pyloromyotomy, was done in the past after opening the abdomen, but is now carried out through a fibre-optic laparascope which allows the surgeon to see his work without having to open up much of the skin, much less the abdomen. Often babies can start eating a few hours after surgery and can go home once they are eating fairly well.