Foam around a horse’s mouth is not unusual to see during or after a ride. Moderate amounts of saliva or foam indicate acceptance of the bit. Huge amounts of saliva can indicate discomfort in the mouth, causing excessive salivation (or can be caused by ingesting some types of clover), and a lack of saliva can create discomfort from dry metal irritating soft mouth tissues.
The amount of saliva shown here is normal and healthy, perhaps on the minimal side but this photo was taking after a short trail ride, not a ride in which the horse was particularly asked to accept and engaged the bit (in which case more foam would be expected). Classical dressage riders prefer to see this type and amount of mouth foam, sometimes referred to as “lipstick”.