Various cellular carriers have long offered purchase price subsidies, in exchange for a cellular plan contract.
You pay less up front for a locked phone, but you pay more over time, having fewer plan choices, and having a phone locked to a specific carrier; the cost of the subsidy is embedded in the monthly payments over the duration of the cellular plan.
Some carriers won't ever unlock a locked phone. Even when you complete the contract. Some others will.
For phones that are pre-populated with a SIM or eSIM for particular carrier but that do not offer a purchase subsidy, I'd expect the phone to be unlocked, but you'll want to confirm that with the carrier.
If you pay full price from Apple and with no carrier subsidy, then you will get an unlocked iPhone.
The carrier might charge for porting an existing number to the phone, as some do.
But the phone will be carrier-unlocked.
iPhone 13 is often pre-populating the eSIM with the carrier, which is a change from years past when the use of a carrier SIM was more common