Paid proxy providers need a way to confirm a connection is actually you and not someone else piggybacking on their service. There are two dominant approaches.
Username and password
Credentials are embedded in the proxy connection string itself, so any device using those credentials can connect regardless of its own IP address. This is convenient if you connect from changing locations, like a laptop that moves between networks.
IP whitelisting
Instead of credentials, the provider only accepts connections from IP addresses you've pre-registered. There's nothing to type or store in code, but it breaks the moment your own IP changes, which is common on home internet or mobile connections without a static IP.
Free proxy lists
Public free proxies typically use neither — no authentication at all, which is exactly why anyone can use them and why they're shared, unreliable, and sometimes already overloaded by the time you try them.