The work and residence permit is a permit, the most important and essential document in the whole immigration process, as it will basically directly result into the final residence permit in Spain.
For third country nationals the work and residence permit directly also results into the NIE. Please see an example here.
The visa is only required as a step in the process (after the work permit/assignation of NIE) and is only needed to enter Spain.
Once you have entered Spain the work permit/residence permit then needs to be transferred to a physical card, which is the famous TIE. This is also called "Permiso de residencia" and you can see an example here.
The work and residence permit will be transferred into the final residence permit by applying for the TIE, the actual physical card (Tarjeta Identidad Extranjera).
The work permit is typically issued for two to four years (two years in Ley 14/2013).
SUMMARY:
Permiso de residencia y trabajo ( Work and residence permit): decided upon before arrival to Spain and needed for the visa. The visa is then only needed to enter Spain.
Infographic Below: