The type of card is determined based on the BIN (bank identification number) which is the first 6 numbers of the credit card. I think it relies on someone maintaining the correct data (probably in multiple databases worldwide). I have a DKB M&M personal mastercard which on many websites is identified as a business card (and a surcharge charged)....
You can check one database here:
https://www.bincodes.com/bin-checker/