Orphanages have been around for hundreds of years. The very first orphanages were founded as far back as the 1st century, though the orphanages we know today started to pop up more and more in the 1950s. A lot of the children in the United States in orphanages were there because they had lost family in the war. More orphanages popped up around the world, from Jewish orphanages in Israel to ones in Africa to take care of the many children there. As things have changed there are not as many orphanages in the United States as their once were, but there are still plenty to be found in other countries.
The kind of care given to kids in orphanages varies depending on their age. Many will take in children as young as infants and do the best they can to raise them and give them the proper nutrition and care they need to grow healthy and strong. As kids get older they'll be educated, usually in-house. Classrooms are often set up to teach kids everything from their alphabet and multiplication tables to useful vocational skills that will lead them to solid jobs when they eventually leave.
Many orphanages also often allow for adoption of their children which makes it easier on them to have more room to take in other kids and gives those adopted a chance at a normal family life. It's the best outcome for a lot of these children. Sometimes it also happens that there is family that they didn't know about who discovers they have a niece or a cousin in an orphanage and steps in to take care of them. It happens more often than people would think!
They are an important institution in society. They give children the kind of upbringing they need regardless of their family situation.