Say you have a list of full names and you want to teach a computer to get the first name out of each.
With "program synthesis", you provide a couple example outputs, and the computer tries to generate ("synthesize") a program that turns the input (i.e., the full name) into the output (i.e., just the first name).
Basically, this works as follows. You generate a ton of candidate programs, and then rank them that work for the input, and choose the "best" among them, and return that. The ranking is a bit of an art though.