In both infection by the virus and mRNA-mediated expression of the spike protein, spike proteins are produced in the host cell as membrane-bound proteins; they're not just separate particles floating around. Whether or not the rest of the viral machinery is present, these will end up displayed in the membrane of the infected cells. Here's a diagram showing that process in infection (note the little "blue spikes" in the cell membrane at the far right):

Figure from Duan, L., Zheng, Q., Zhang, H., Niu, Y., Lou, Y., & Wang, H. (2020). The SARS-CoV-2 spike glycoprotein biosynthesis, structure, function, and antigenicity: Implications for the design of spike-based vaccine immunogens. Frontiers in immunology, 11, 2593.
B-cells will recognize these foreign antigens, again whether their production was initiated by the virus or by a vaccine (here the equivalent of the "blue spikes" in the first figure are the "green S protein"):

Figure from Teijaro, J. R., & Farber, D. L. (2021). COVID-19 vaccines: modes of immune activation and future challenges. Nature Reviews Immunology, 21(4), 195-197.
(note: don't be fooled by the separate mRNA and AdV vaccine strategies here; the outcomes and mechanisms are the same, the diagram is just condensed to show both in one figure)
With mRNA vaccines, production of spike proteins is limited in time and space: to the cells that take up the injected mRNA, and only until that mRNA is degraded.
With normal infection, production of spike proteins is only limited by the course of the infection: as long as the virus continues to replicate, spike proteins will be produced in the membranes of affected cells, and can be produced anywhere in the body that the virus spreads (though principally in the respiratory compartments where the virus preferentially infects).