In the UK there are three different parts of the complete system: generation, transmission and distribution, and supply (sales) to customers.
There are many companies that generate electricity, varying in size from national (and even international) companies down to small organizations that operate a few wind turbines at one location.
There are two parts to the transmission and distribution system. The "National grid" is a single system for long-distance transmission between large generating plants, operating at high voltages. This feeds local "distribution" networks operating at lower voltages and eventually connecting to individual customers (i.e. houses and factories).
Electricity supply companies buy power from the generating companies, pay the transmission and distribution companies to transport it, and sell it to individual customers.
Usually, domestic customers are only connected to one distribution network and have one electricity meter. If a customer wants to change supplier (e.g. to get a better price) nothing is changed physically. The customer's meter readings are used by the new supplier instead of the old one. The supply company knows the total amount of electricity it is selling (using the meter readings) and buys that quantity from the generator companies. The buying price changes continuously depending on supply and demand, but the supplier company sets its own price to sell to customers.
Some large (national) companies may operate both as both generation companies and supply companies but the two functions are logically separate.
Note, the UK supply network does not actually end at the borders of the UK - for example there are links to France, Belgium, and the Netherlands which can operate in either direction depending on supply and demand. On average, around 5% of the electricity used in the UK is actually generated in Europe.