In music, accompaniment indicates playing to support another instrument (including voice), choir or even dance. This contributes to an integral whole. Accompaniment is done using polyphonic instruments or groups, such as keyboard (especially piano), orchestra or even guitar. This is because they are capable of harmony, whereas monophonic (having a single melody line) instruments are not. Most instruments are monophonic, including the human voice. Although orchestral strings can sometimes produce more than one sound, they are still considered monophonic.
The piano has many roles, functions and benefits, including being one of the best means of accompanying instruments or singers. In classical music, it is uncommon to have a monophonic instrument be composed entirely for solo. There are such pieces, but again, they are rare. Works for such instruments are composed to include either orchestra or piano. During rehearsals for concertos, which could be any instrument, the piano can be used instead of the orchestra, even for another piano, as in a piano concerto.
Another unique way of accompaniment is accomplished during solo piano performances where one hand, typically the left, actually accompanies the right hand. To specify, since the piano is capable of producing several sounds simultaneously, one is the main melody line and the rest accompany it.
The biggest misconception regarding piano accompaniment is that it is a secondary action. True, it supports the melody line, but that does not mean it is of secondary importance, especially in sonatas or other similar forms written for an instrument and piano. The part could be quite challenging. The melody line can be in both instruments and there is a musical dialogue involved.
Prestigious schools of music around the world actually teach accompaniment as a more advanced technique, when the pianist has already become a virtuoso. This is because proficient control of the entire performance is required on his part. If the instrumentalist miscalculates, for example, the accompanist is one step ahead at all times and will catch it and manage it, ensuring a solid performance. Miscalculations are very rare with world class performers, however, but they are still possible. He also follows the instrumentalist and every nuance of detail, including tempo, mood, sentiments, etc., and must do so perfectly. He must be alert just like a conductor is. So he must be an accomplished virtuoso first, just as a judge should be an accomplished lawyer, a headmaster a teacher, and a dermatologist a general practitioner.
If piano accompaniment was so secondary in importance, no world class pianist would ever do it, as it would be a threat to their status and career.
If one is not a professional pianist, but is an amateur or a student, he/she should not be discouraged from trying his/her hand at accompanying, because for nonprofessionals, the primary purpose of learning piano is for enrichment and fun. And requiring lofty expectations of amateurs may ruin their enjoyment. A good piano teacher will be able to teach it at any level, for the right purpose.