Soldier beetles are often mistaken for lightning bugs but are actually predatory insects. The spend a lot of time on flowers, and will eat pollen and nectar – and do some inadvertent pollination in the process – but their main food source is other insects, including aphids.
Soldier beetles are a very common species in prairies and in town. Here in Aurora, we see sometimes them in large numbers when linden trees are blooming. This one was in my native prairie garden, hanging out on wild garlic (onion) flowers.