Usually the artist gives the company limited reproduction rights. This means that the company has the right to reproduce the art in a specified manner for a specified length of time. This does NOT give the company ownership of work or copyright. Some companies may demand full rights, including copyright. This is where an agent is especially useful in that they know what the company is demanding and whether you should deal with this company.
Compensation is usually in the form of royalties.
There can be a deal where the artist is paid an advance against future royalties. Otherwise the artist is paid a percentage of profit derived from sale of products bearing the artist's work. The contract should state that any time the artist's work is reproduced and sold that the artist will receive royalties on that sale. A licensing contract is worked out between the artist and the company. Usually the duration is several years.