I'm very very glad to learn this! Thank you for persevering!
The number of moves available is derived from existing tile types as well as board dimensions. It isn't a "smart" calculation, but rather a "safe" one (more than enough to clear any level). This only works because levels aren't about maximizing or minimizing score - the required score calculation is purely tied to grid dimensions :)
Levels are generated randomly, through basic seeded rng. To avoid having all levels look like noise, some seeds roll some mirroring modifiers - horizontal, vertical and axial. And that's really it!