How does product/market fit occur?
It usually happens when there is a lot of intimate knowledge of customer needs. This may mean building a product and then learning from the customers that use it. Or, it may be doing research before developing a product.
What is the primary reason that someone loses product/market fit?
Not paying attention to the customer. Developers must always be asking what the next problem is that they can solve for consumers.