The information contained here about rates of pay is general in nature and will differ from country to country. Be sure to research the relevant information for your specific area.
In a nutshell, a session musician is a musician who comes on board to play during a "session" - be it in the studio or on stage - but who is not part of the band. A session musician may come in and play on one song during a recording session, or they may join a band for an entire tour. When a session musician makes a one-off contribution during recording, the lines between the session musician and the band are quite clear and distinct to everyone involved, but when a band tours with session musicians on tour for a long period, it is easy for these lines to be blurred if there is not a clear agreement in place.
When a session musician comes on board, there should be a written agreement in place that makes clear that the musician is performing the capacity of a session musician and not as an actual member of the band. In many countries, there are set rates of pay that session musicians should receive for studio recording and live performances - these rates of pay differ from country to country and can be found out by contacting groups like the Musicians' Union or the American Federation of Musicians. If there are no official "set" rates for your area, there will certainly be an accepted "going" rate that the session musician should be paid.
In exchange for these set rates of pay, the session musician signs away their future rights to the recordings. That means that if a session musician plays on an album that goes platinum, the session musician doesn't get to come back for a piece of the profits from that recording. The same goes for a live show. The session musician gets paid their set rate of pay whether the show lost money for the band or the show was a major money maker. There are rare instances where bands offer their session musician a future percentage of income from the recordings on which they took part, especially if the band cannot afford the session musician rate - but these deals leave a lot of opportunities for exploitation on both sides. Band members and session musicians will all benefit from having a clear contract in place.