The cassette is the cluster of sprockets on the axle of the rear wheel. It is a set of sprockets and spacers with no moving parts as it slides on to a cassette body around the axle which contains the moving parts and is locked in place with a lock ring.
The number of sprockets determines how many gears you have and what ‘speed’ your gears are ie when you hear people say they have a 10 speed groupset they have 10 cogs at the back, 11 speed is 11 cogs etc. The number of teeth on the sprocket determines how easy or hard it is to pedal; the lower the number the more difficult to pedal whilst vice versa with the more teeth the easier it is. Sprockets cannot be mixed so you buy whatever ratio you need in a pre determined format, eg 12- 30, but there is a wide choice of ratios available and the cassette is easy to change with the correct tools.
Shimano is the dominant manufacturer for off-road suitable cassettes but thankfully SRAM cassettes also fit Shimano hub bodies giving you more choice. The only caveat is that you must use a corresponding number of sprockets to your gear mechs, levers and chains, ie 10 speed with 10 speed and so on, for perfect shifting. Likewise if you upgrade to a higher number of sprockets on your cassette you must upgrade to the similar compatible number on your gear mechs, levers and chain.