The internet is overflowing with information regarding probiotics, and since these products are not registered as drugs and are widely sold as nutritional supplements, it might be hard to "separate the wheat from the chaff".
I found this review which seems pretty comprehensive, and extracted some key concepts that may answer your question (they will be italicized hereinafter). First, some basic terminology is in order:
- Microbiota - this is a general name for a "community" (for lack of a better word) of different types of microorganisms. Specifically, the human microbiota is the entire community of microbial organisms that inhabit the human body. See this text for elaboration.
- Microbiome - this is a general name for the collection of genes of a certain microbial community. The human microbiome is the collection of genes of the human microbiota, and is the subject of an extensive study due to the potential health benefits its manipulation may provide.
- Gut microbiota - this should be clear already... this is the entire microbial community that resides in the digestive system. It is also called 'gut flora'. This concept is not unique to humans, so we will refer to the human gut microbiota from now on.
- Probiotics - as ProfK correctly noted in his comment, probiotics is the commonly used name for the content of "good bacteria", which are essentially the same bacteria that naturally inhabit our digestive system (specifically the colon), in the form of a commercial product.
Regarding your first question - What are the bacteria in your large intestine doing that benefits health/immunity?:
Gut bacteria use mostly fermentation to generate energy, converting sugars in part to short-chain fatty acids (SCFA) that are used by the host as an energy source. The main end-products are acetate, propionate, and butyrate. SCFA help increase gut motility, decrease gut pH, and provide energy for commensal bacteria. Besides SCFA, a number of amino acids that are indispensable to humans are provided by commensal bacteria. It has been well established that some microbial species may be responsible for the synthesis of vitamins like biotin, phylloquinone, and vitamin K, and deficiencies may directly or indirectly be associated with reduction in abundance of specific components of the gut microbiome. The gut microbiota also plays an important role in preventing comorbidities and infection in addition to influencing mood regulation, obesity, diabetes, insulin resistance, and cognition.
Regarding your title question - How do probiotics work? - I will only cite this short paragraph: Probiotics can act through multiple mechanisms to affect the health of the host. They can transform dietary components into bioactive molecules, modulate the microbiota, or interact directly with the host immune or nervous system.
Please see the section on mechanism for a deeper explanation and specific examples for probiotic mechanisms.
Final point: many studies show all kinds of health benefits associated with probiotics in different states of disease. They cannot be covered here, but the review I cited can be a pretty good starting point. One of the main uses of probiotics is following (or together with) an antibiotic treatment, in order to replace some of the gut flora that might be destroyed by the antibiotics - antibiotics do not differentiate between "good" and "bad" bacteria, and some research (e.g. this study and this study) indicates that taking probiotics close to an antibiotic treatment may help to restore the gut flora (which has a significant role in the human body as discussed earlier) faster and help to overcome the bacterial infection better and faster.