In the 1990's and early 2000's, Modbus RTU (RS-485), generally used 15 or 16 devices as the limit. Some time after 2000, that number increased to 32 slave devices.
Modbus/TCP over ethernet uses IP addresses, so routing via gateways is more of an issue than the number of devices on a particular subnet.
An RTU master probably has a spec, but it's caveat emptor (buyer beware) as to a spec for ideal conditions vs reality.
The number of devices is empirically determined by the ability of the each slave device's electronic line driver to drive the line, the amount of noise for where the network runs, and biasing and line termination issues.
All of which combine to say that the manufacturer can claim a high number of slave devices that works on a bench top, but under operating field conditions, that number might drop dramatically.