The fate of equipment purchased with research funds generally follows one of three trajectories:
Small common equipment below a certain threshold of cost is typically categorized as something like "office/lab supplies" and is effectively treated as part of the overhead costs of doing research. Different organizations have different ways of categorizing and budgeting such equipment, but it generally includes things like laptops, pipettes, staplers, etc. These items will be owned by the research organization, but below some threshold they are ignored and treated as being owned by individual researchers (they care about your pipette, but nobody's going to track your pencils).
Specialized and/or costly equipment typically belongs to the funder of the project, unless specified otherwise as part of the contract. For example, the US government almost always retains ownership of equipment purchased using research contract funds. After a research contract ends, one of two things happens with such equipment:
A. The equipment remains in the hands of the organization, either rolled over into use by another contract or simply ignored and abandoned by the funder. In my experience, this is by far the most common outcome with research equipment, since it is generally useless to others and/or difficult to transfer, and the funder is often not interested in holding it in inventory.
B. The funder requests that the equipment be shipped back to it. This is most likely to happen when the funder is concerned about alternate uses that the equipment might be put to (e.g., supporting an industrial competitor) or is planning to give it to another organization.
One of the common frustrations is that it's often difficult to tell whether you're dealing with 2A or 2B, especially when dealing with the government, which may take years to get around to requesting something back. In the meantime, the organization still needs to track and maintain custody as though expecting the funder to want the equipment back.
Now, in all cases, the PI does not own the equipment, but if it is worthwhile to transfer a piece of funder-owned equipment to a new organization, the funder may be quite willing to do so, just as they may be willing to transfer funds to follow the PI.