
Optimal profitability
Let's start with the best way to mine, what's called the Nash equilibrium strategy: the absolute cheapest operational costs currently scientifically possible on earth.
If you could accomplish this, you will be among the group of miners that stays profitable the longest. According to gametheory, because of capitalism eventually almost every single miner has to run this strategy in order to be profitable at all.
Reality
In any competition you have a normally distributed mix of skill levels among participants. Crypto mining is no different. The current hashrate is comprised of many different skill levels, but the only way to profit is to have costs that are less than the average of all participants. But it's not that simple, there are many dynamic factors at play:
1. Electricity cost
This is by far the most important factor to determine mining profitibility!
2. Hashrate (mining difficulty)
This changes constantly, but the actual mining difficulty is only calculated once every 2016 blocks which is roughly every 14 days.
3. Token price
Since crypto is a new technology the prices are still very volatile. This means that one year you could be profitable and another year you lose all profits again or worse.
4. Technologic advancements
Moore's law explains that computation power (per $1 investment) is still increasing at a rapid rate. Basically only a few months after buy your Bitcoin (ASIC) miner you are already less efficient than a miner who starts after you with more efficient hardware.
5. Adoption
Besides the risk of price volatility, there's also a clear mining trend you can see in the network hashrate over time:

Currently this means during the early adopter phase of crypto if the token price does not double in a very short timespan you will make less revenue, because the fraction of the total hashrate you own is consistently exponentially getting smaller!
Conclusion
The game is all about trying to minimize risks and costs and try to predict the future (token price, technology, psychology, legal policies, etc) as good as possible. But regardless of these complex dynamics of a mining operation, at any given time the sum of all profitable miners roughly earn the exact amount that the others lose in total (some profit or lose only a little bit and some profit or lose the maximum).
With smart preparation you will know in advance with reasonable certainty where on the profitability Bell curve you will be, but in reality many people don't understand the complexity and get burned really hard!