Watch the video
The story of trying to cram a whole shoebox of electronics into a pocket involves dodgy corporate dealings, people starting their own companies and deciding that while calculators were nice, being able to program them would be even better.
Part of the difficulty of building a calculator is working out how to understand the maths the operators were entering. A basic four function calculator can be thought of as a simple state machine, but once we get to doing scientific functions or longer multi stage formulae. And this is where a technique known as Reverse Polish Notation comes in.
Back then computers were too low powered to cope with parsing text and checking for dumb human things like missing brackets or maths that made no sense. So we had to do that for them.
The history of how the modern computer came to be is pretty interesting. There’s a fascinating explanation on this website, which was then turned into an equally fascinating book that you should go and read. Here’s a link to the Google Books version, but the real thing is better to read.