Which agencies or companies might decide to ground an aircraft series, and in which situations can this occurr?
There are various levels that a grounding can occur at.
Governing Agency: A legal authority can ground an aircraft make/model/serial number range (or one containing a certain part/system) if it deems they are unsafe or there is some question about the airworthiness. The most recent example of this was the recent grounding of the 787's by the FAA after the battery issue was called into question. Governing agencies can also practically ground an aircraft/make/model by issuing a mandatory AD against it; this will practically ground all airframes until proper maintenance occurs. A federal entity may also chose to not certify an aircraft for operations within a country, and/or the manufacturer may chose to not seek certification in that country although some countries allow one off certificates to be issued. In emergency situations the local governing body may shut down and ground all aircrafts in a certain area. The most prominent example of this that I know of is when all aircraft were grounded following the 9/11 attacks; this is generally more of a ground safety issue than an airworthiness issue.
Operator: The owner/operator can ground an aircraft for safety reasons if they belive there may be an issue with the functionality or operation of the aircraft in question. A good example of this is the grounding of the Southwest 737 fleet due to weight and balance issue, this was done by the airline potentially before a governing authority intervened. Another example was ANA's grounding of its 787 fleet due to engine problems.
Pilot In Command: As the pilot in command of a flight and the one responsible for ensuring the safety of the flight you can ground an aircraft for any reason you so chose and be well within your rights. Let's say on your preflight checks something is out of place or looks wrong; in such a case, the pilot can ground the aircraft until the issue is fixed.
Maintenance Persons: Generally when attacked from this angle it's more of a prevention to return to service than a grounding, but if an issue is found during a stage check or annual the aircraft may be pulled until the issue is fixed. There is an interesting article about withholding maintenance signatures here.
Recall: Manufacturers generally provide AD's instead of a full blown recall however some cases may warrant a full blown recall of airframes. When Porsche dropped the TC for the PFM3200 engine Mooney offered a recall of sorts, the owners could either sell the aircraft outright or the engine retrofit would be subsidized.
If a problem is found to be common to a design or probable manufacturing defect in a production range than the FAA will issue an airworthiness directive, which requires some action within a certain time frame, the time could be immediate or at the next regular maintenance. ADs can be one time fixes and inspections or continuing. Aircraft manufacturers can also effect the same directive for inspections or maintenance by issuing a revision to the operations and maintenance manuals.(as the FAA requires compliance with the latest manuals) The issue may be due to the base product or due to difficulty with adequate compliance in the field.
In the USA an individual aircraft is grounded anytime it is not legally "airworthy", this can be wide range of items and can be conditional on specifics of the intended flight: not having the registration card, operators manual, or other documentation; mandatory FAA inspection, maintenance, or modification directives "airworthiness directives"; not meeting the mandatory minimum equipment list; even a required inspection one hour overdue; parts found in questionable condition during the pilot in command's preflight inspection will ground the aircraft until addressed by the correct engineer/technician(who may approve the condition as not a safety hazard, make a temporary repair to be further addressed at the next inspection, or full repair on the spot).
Sometimes grounding is conditional on flight conditions, if your attitude indicator not functioning (and properly labeled as broken) the plane is not airworthy for instrument meteorological conditions but it is airworthy for visual flight conditions. Other times it could be conditional on the purpose of the flight, a flight for hire(regulation 135 or 121 operations) will have different requirements from a general flight(part 91 operation) for private or internal company business. It could also be based on pilot currency, the plane may have operational equipment for very low visibility landings but the pilot has not practiced this combination within a certain time-frame then the plane-pilot combination cannot fly for hire under those conditions and is effectively grounded until forecast conditions improve or a pilot that is current with the equipment and conditions can be called in.
Also special ferry permits can be issued to make an aircraft airworthy for a single trip under specific conditions. Ferry permits are most often to move an otherwise non airworthy aircraft to a maintenance or inspection facility; using minimum crew, no passengers and no paying cargo, in good weather during the day on a route that avoids dense population areas. They may also be used for odd cases like a new aircraft that has yet to be registered to the owner.
In many top tier companies and nations, there are "no fault" rules to protect pilots for retribution based on any safety related decisions. That is if a pilot doesn't like the sound of the engine and refuses to takeoff until it is fixed or aborts a landing or diverts to a different airport because of landing, the pilot will not be punished in any way. However this is not the case in all countries and companies, in some places they do not have much of a safety culture and pilots will be quickly replaced by others who only consider the immediate cost to the company.(coughAsiacough) To such an extent than the EU has blacklisted several airlines for extended periods(many years), such as Lion Air. The FAA does not blacklist outright but it does assess some airlines as "not being in compliance" with international standards and recommends US citizens travel direct on more reputable airlines. https://www.businessinsider.com/lion-air-banned-from-the-european-union-2013-4 I do not want this to mean that all airlines from a region are bad, there are good airlines in all regions, but the prevalence in certain areas is notable.
I had a longer answer but cut my self short as I was kind of leaving the specific question and going into general safety trends in the airline industry.
When you are talking "aircraft series" it suggests a worldwide grounding of an entire fleet of a type. This will be normally be implemented by the OEM's regulator in consultation with other affected regulators (generally when one issues an AD the others automatically adopt it) and the OEM.
When a safety incident or crash happens it triggers an airworthiness process between the manufacturer and the regulator of the incident country and manufacturer's home country (usually led by the home country's regulator/investigation authority in coordination with the crash host's).
There is a standardized mathematical risk process that is followed to determine what mitigations are required, and how soon they are required, and whether interim mitigations can be applied, to reduce the risk of a follow-up event to an acceptable level. At one extreme, you have ground the fleet right now, and at the other end, you might just have a procedural change.
Grounding an aircraft series, as the most extreme action, is done only when the existing risk is so high there are no procedural mitigations or maintenance actions that can be done until a design change can be installed. They try to avoid this at all costs, but in rare cases, like the 787 battery fiasco, there is no choice and they are forced to issue an AD with no mitigations or phase-ins that grounds the fleet until a Service Bulletin with kits is issued.