Shopify’s client id corresponds to the _shopify_y cookie (at the moment). It is per browser per device. It arrives from a Set-Cookie header when loading a page.
If two people use the same computer, the same browser, and in the same session, I think they can possibly get the same client id. Otherwise, because client id is basically a UUID, the probability that two users ever have the same value is something like one in several billion, so basically, no, two people will not have the same id.
Think of clientId as a unique anonymous id. It identifies an unknown person using a particular browser.
If someone clears the _shopify_y cookie then I think Shopify will generate a new one on the next page load. I do not think it is guaranteed to be the same as before.
The client id cookie has a 1 year expiration. I think it is extended on each page load. Therefore if someone visits, then does not visit for 365 days, then visits again (loads a new page), they will get assigned a new client id, because the cookie expired.
Shopify does not merge the client ids. However, if someone authenticates (e.g. makes a purchase and becomes a customer, or logs in), then you learn about their customer id. Then you can associate their anonymous client id with that customer id. In other words, each customer id might be associated with multiple client ids. For example, if I login from two different browsers (e.g. my phone and my laptop, or two different phone apps), or I login after a year in the same browser, then I have one customer id and two client ids.
It is best to think of client id like an anonymous device identifier.
You are on your own regarding how you associate one or more client ids with a customer id. There are many companies and programs and apps that help you with this, or you can write your own code that stores the associations of the two in a database. Or if you use pixels, some pixels will accept two ids, one being the anonymous id (the client id), and one being the user id (the customer id).