New rear wheel compatibility with existing cassette
One point not mentioned is the rim internal width.  This directly affects what widths of tyre can be mounted.  That is, a 60mm wide tyre will mount better on a wider rim than a 25mm tyre.
Additionally, tubeless rims are a thing.  If you want to run tubeless tyres, then a tubeless-ready rim makes sense.  If you're happy running clincher tyres with tubes, then this is less of an issue.
The hub's cassette interface has to match with the cassette you intend to run.  Options like Microspline are available.  As long as your cassette fits the hub, then the chain/derailleur won't know or care.
Spare parts - if the hub you get is some odd or rare item, then finding a new freehub in a couple of years could be hard.  Less of a problem than it used to be.
You want to consider your riding style as to the number of spokes - a rear wheel with more spokes is better at carrying a load or surviving a bad landing, while a wheel with fewer spokes is reputed to be lighter/more aero, but one spoke going can drop the whole wheel out of true enough to bind the wheel in the frame.