It works by magic. First you run the compilator to turn your code into a real program--called an executional. Then you execute the program--sometimes called runnification--and type answers to the questions it asks. The program remembers all of your answers and magically prints them out at the end.
Because the program asks questions, it could be called AI, or "ambidextrous intelligence".
When the program asks you for the name of an individual, you have to provide the name of a real person or the results you get will not be valid.
You should add social security numbers to the Person class when working in the USA. This will make the program safer.
When asked to enter a character, the program prefers a character from the Star Wars series, such as Luke Skywalker or Jabba the Hutt.
In this line: list.push_back(new Person(name)); a new person is really a baby, so the code is telling the list of people to pat the baby on the back. I think they are trying to burp the baby.
The line getline(cin, exit); really means do your own homework, and then you will know what your are doing. Because the line is written twice, it means you really, really need to do your own work.