Research often derided for being a waste of money has led to world-changing breakthroughs, ranging from GPS to Ozempic.