IP addresses are almost always assigned dynamically using DHCP. DHCP uses your MAC address along with possibly some other things like the hostname and UID (unique client identifier). Your router that you normally use to share your IP address with all of your computers has its own MAC address, just like your computer does when you connect it directly.
The DHCP server remembers all the MAC addresses that were recently used to obtain an IP address and it tries to hand out the same IP address each time the same MAC address is plugged in, if the IP address hasn't been reused and assigned to a different host.
A regular DOCSIS cable modem will allow you to have up to 7 devices connected directly to it using an Ethernet hub or switch. Whether or not this will work depends on if your ISP allows it. Some will allow multiple devices to be plugged directly and obtain separate public IP addresses, at least for a while. Others may want to charge extra money to have an additional host connected directly. It seems like your ISP allows multiple devices to connect directly at once, at least for a while.
If your ISP does not allow multiple hosts to be connected directly at the same time, connecting a new host with a new MAC address may cause the account sign up captive browser portal to show up. Then you have to enter your account information to allow the new router or computer to connect.
ipconfig
orncpa.cpl
or the Windows' settings app?