I run two different eMTBs - a hardtail KTM Macina Action (2014), and a full-sus Scott E-Genius 730 (2017). In rear cassette terms, the bikes were supplied with a Shimano HG-50 and a Shimano HG-81 respectively (since the Scott is the more expensive bike, I assume that the HG-81 is a better cassette, perhaps in materials or expected longevity).
Both cassettes are 11t to 36t, and both are ten-speed; I've not counted the non-outer cogs but I would assume they are the same. Historically I have purchased cassette+chain bundles, and always bought the model to match the factory-supplied unit.
However these models are getting a bit older, and my (large corporate) suppliers for the UK do not stock them, suggesting that perhaps ten-speed is dying as an MTB format. Thankfully, eBay UK has stock of both.
Are these two cassettes interchangeable? I'd like to understand that question in relation to these specific cassettes, but also, how can I answer this question in general? For example, if Shimano offer a range of 10-speed MTB cassettes, and they all begin with "HG", is that enough to know they are compatible? If not, what should I look for (e.g. in terms of the name of the mounting type) so I can select other 10-speed Shimano cassettes, knowing that they will fit?