In former times, onigiri was called tonjiki. In the Heian period, tonjiki was a meal given by the nobility to people of lower position to eat when they were outside.
Until the beginning of the Showa period, the people rolled leftover rice into balls, broiled the surface and then spread it with soy sauce. This was called yakimusubi. It was very popular for its homemade flavor.
Now, many kinds of onigiri which contain different fillings, such as yakiniku (grilled beef), tuna salad, etc., are sold at convenience stores.