India is playing proxy to the US; as they clearly had the nod from the notorious hawk John Bolton to attack Pakistan. US obviously needed to know the capabilities of the Indian forces as they want it to take on the larger China in the near future. But Bolton was quite disappointed as India got a spanking of the century.
What India did underestimate was the resolve of the Armed forces to fight back and inflict a deep wound. They received a ton of damage in return in addition to lost pride. They lost fighter aircraft; senior airmen, supply depots. Their media does propaganda very well; but it is restricted to internal politics.