I know that subnetting helps in dividing the internet part and physical address + host part. Like, a class C prefix uses 3 octets for internet part and 1 bit for physical address + host part. I'm reading this book and they keep referring that subnets are used in the internet. But how do the router happen to change the last part of the public IP address to send request for a particular host in the local network? Does the router have control over the last octet to change it by itself? Or the subnetting technology is used for local network only? And does the ISP have any control over how we use subnet? Like my public IP is 22.214.171.124. Does it change the last part 112(if it were using Class C) for different hosts in a network?
When talking about your specific address, you're talking about a /32. Your network might be in any subnet your ISP sees fit.
Example: 126.96.36.199/16 is the network as received by your ISP from its local IP authority. They might divide it further for different routers, CMTS, dslam or whatever your technology uses, so let's say you receive your 188.8.131.52 in the subnet /20. An internet router might have in his table the full network as 184.108.40.206/16 in its table, but then it need to forward packets to your address, a specific /32, so he thinks: if I take the first 16 bits of this address will it match this 220.127.116.11? If yes, it forwards your packet to "network 18.104.22.168". As the packet reach your ISP network, /16 is not enough anymore, so your ISP router looks for the network 22.214.171.124/20, which is the network address for the network your address is in.
It maches ones and zeros, from left to right, that's why 126.96.36.199 is the network address of 188.8.131.52/20, even if the third octet is not the same. Very confusing at first. Keep practicing and you'll get the hang of it.