How Does the State/Province Autocomplete Field Work in Address Doctype?

I’ve noticed that when adding an address in the Address doctype, the State/Province field is an autocomplete field. When I select “India” as the country, it automatically shows a list of states.

Can someone explain how this functionality works? I couldn’t find any related code in the JavaScript file. How is the State/Province field populated based on the selected country?

Thanks in advance for any insights!

It’s a long structure code.

Reference:

@NCP Thanks for your response. I will check the flow