Sometimes jokingly referred to as "chest candy" by soldiers, those are service ribbons, also called ribbon bars, and they're essentially a UX concession to troops. To explain, a soldier may be awarded a medal such as the Purple Heart, which looks like this:
…or civilian clothes, if the medal is awarded after their service has been concluded:
In 2010, Congressman Christopher Smith presented the Purple Heart Medal to Tuskegee Airman Tech. Sgt. (Ret.) George Watson Sr. with then Col. Gina M. Grosso, Joint Base McGuire-Dix-Lakehurst commander. The medal was awarded 66 years after he sustained the injury warranting the medal. Image: Wayne Russell
In those ceremonies, it's not difficult for the soldier to have a single medal pinned to their clothes. However, soldiers can receive medals for personal achievements, unit achievements and for serving in particular regions. For instance, soldiers who served in Afghanistan for 30 consecutive days (or 60 non-consecutive) are awarded the Afghanistan Campaign Medal, which looks like this:
It should be noted that while service ribbons started out as practical reductions of suspension ribbons, these days there are some service ribbons that do not have corresponding medals and suspension ribbons; those service ribbons are the entirety of the award themselves.
Here are some examples of service ribbons from the various U.S. Armed Forces: