What does earthing do in electrostatics? What does earthing actually do in electrostatics? As far as i know, it simply sets the potential of the object that is earthed to zero.
To explain my question further with an example, consider this question i had to solve recently:

In the diagram shown, we have three large, identical parallel conducting plates A, B and C placed such that the switches $S_1$ and $S_2$ are open initially, and they can be used to earth the plates A and C just by closing them. A charge $+Q$ is given to the plate B. It is observed that a charge of amount:
(A) $Q$ will pass through $S_1$, when $S_1$ is closed and $S_2$ is open
(B) $Q$ will pass through $S_2$, when $S_2$ is closed and $S_1$ is open
(C) $Q/3$ will pass through $S_1$, $2Q/3$ will pass through $S_2$, when $S_1$ and $S_2$ are both closed together
(D) $4Q/3$ will pass through $S_1$, $-Q/3$ will pass through $S_2$, when $S_1$ and $S_2$ are both closed together


The correct options are given to be (A), (B) and (C). Applying my definition, i found that the option (C) is correct by making the potentials of the plates A and C due to the other two equal to zero. But i am struggling to do so when only one of the plates is grounded. Whatever charge may flow from the earthed plate, it should not affect the potential of the plate itself (does it?). It is influenced only by the other plates and the charges on them.
This begs the question, what actually happens on earthing something in electrostatics?
Also, how can we solve it without using the capacitor treatment? I am trying to understand the underlying physics of it!
Thanks.
 A: The credit to this answer goes to @knzhou, who provided it to me in the chat.
What earthing does is simply equalizes the potential of the Earth (as in the planet, or the ideal earth, whichever is relevant). Now, we see that to calculate the potential difference between the plate (or whatever it is to which the earth is connected) and any point on or in the earth, we integrate the field as:
$$ V_{\text{plate}}-V_{\text{earth}}=-\int_{\text{earth}}^{\text{plate}}\vec{E\,}\cdot\mathrm d\vec{r\,}$$
There are many points which lie on the earth, and hence for the potential difference to always be zero, the electric field (outside of the region between two plates) must always be zero. For the example discussed, this is only possible if the plate A gets a negative charge $-Q$, which it takes from the earth itself.
A: You can think of the arrangement as two parallel capacitors with a common connection $B$ which has a charge $+Q$ on it for all time.  The capacitance of $BC$ is twice that of $AB$.
Equal numbers of positive and negative charges are induced on plates $A$ and $C$.
When both $A$ and $C$ are connected to earth they are then at the same potential and so the potential difference across both capacitors is the same, so capacitor $BC$ must have charge $-\frac{2Q}{3}$ on $C$ with charge $+\frac{2Q}{3}$ flowing down to earth and also a charge of $+\frac{Q}{3}$ flows down to earth from $A$.
For options A and C the earth removes the induced $+Q$ from the plate it is connected to and all the $+Q$ charge on $B$ moves to the side of the earthed plate.  The other side of $B$ has no charge on it and the remote plate has no charges induced on it.
In simple terms the induced $+Q$ charges have moved as far away as possible from the positive charge on $B$.
A: If an object is positively charged, it gains electrons to neutralise (earth/ground) itself from the earth. If it is negatively charged, it loses electrons to the earth i.e. electrons are transferred from the object to the earth. The earth has this property of giving and gaining electrons freely, because it has so many electrons - it's a bit like this: if you take a bucket from the ocean, or pour water in it, the sea level won't change.
It's the same here, if you get electrons or give electrons to the earth, the difference in electrons in the earth will be so minute that it will have virtually no impact.
A: What actually happens on earthing something in electrostatics?
Grounding a charged rod means neutralizing that rod. If the rod contains excess positive charge, once grounded the electrons from the ground neutralize the positive charge on the rod. If the rod is having an excess of negative charge, the excess charge flows to the ground. So the ground behaves like an infinite reservoir of electrons.  
Suppose we have a charged plate. Once you ground it, it get neutralized. So the charge on the plate disappears. This means the electric field initially present in the rod vanishes. Electric field becomes zero. What does that mean? In electrostatics, we have an important relation:
$$\mathbf{E}=-\nabla V$$
i.e., the electric field (static) is the negative gradient of the scalar potential V. Once we have E=o it means
$$\nabla V = \frac{\mathrm dV}{\mathrm dr} = 0$$
i.e., $V = \text{constant}$ throughout $r$. i.e, the potential is not changing with distance. This means grounding makes the electric field of a charged substance zero and thereby make the potentials of the substance and ground a constant.  
i.e., there is no potential difference between the two terminals (initially charged substance and ground). So no current (charge) flows between them. It's like maintaining an equilibrium.
