Figure skating is a performance sport. Figure skating competitions focus not just on the technical aspect but also the skaters' artistry, and presentation of the program. A friend of mine once remarked that figure skaters tend to have a streak of "show-off" in them. I prefer to look at it as, figure skaters have learned to deal with the pressures of public performance.
How do skaters learn this? As the saying goes, "practise makes perfect" - here, in two ways. First, to work on the program and its elements. Second, to gain experience performing in front of an audience.
For the first, it goes without saying - all skaters spend much time and effort in preparing a program and practising the elements so as to get them consistent. A 'clean' program is more appreciated than a technically difficult one with many mistakes. Putting in elements that a skater cannot do 80% of the time not only makes the program look poorly performed, but also lowers the skater's confidence during the program - unless this is the 0.2n chance where all the n elements are successfully performed!
As for the second, there are not always sufficient opportunities for skaters to perform outside of competition. I recall the first time I had to go out on the ice alone, for a competition. It was daunting, and the fact that it was a cold February day in Boston didn't help. Though that didn't go too well, it made me resolve to overcome "stage fright". The next competition went much better!
Recently, the local rink office told me they would consider having skaters do short exhibitions on weekends. This is a wonderful idea, and I hope local skaters, especially the newer ones, would take up the chance to gain experience that will also help in other aspects of life!