How & why did BlackBerry collapse so dramatically?

As a mid 90's baby, I was only just entering high school in the early 2010's so I wasn't keen on business and the latest trends in the market when BlackBerry was at its height of power. And back in those days you didn't get a cell phone in middle school.

But according to Google, it seems BlackBerry owned over 50% of the US smartphone market in 2010. That's remarkable. And even more puzzling as to how a company with that dominance can just fall.

For those of you that were more mature around 2010, what were the reasons for the collapse? What secret sauce did Apple and Samsung have?