Being able to make things up as we go along is a great skill to have in life, and it's equally important in playing piano. A great example of that happened at a Ray Charles concert in 1958 when Charles and his band had played all of their songs and still had time to spare - he improvised a song he called "What'd I say?", which some say was the first soul song. It became so popular that he ended all of his performances with it from then on.
Some piano players (like Ben Folds) make up whole songs…