$$\large \textbf{(a) Principle of capacitor}$$ -
Whenever two neutral conductors are placed nearby, and a potential difference is applied to them, then equal and opposite charges are induced on them.
Therefore, due to these charges, Energy is stored in the form of Electric Field in the gap between them.
A capacitor is device used to store Energy.
The charge appearing on the conductors is directly proportional to the Potential difference applied to them. i.e.
$$Q\propto V$$
$$\Rightarrow\ \ Q = CV$$
Where C is the constant of proportionality, called capacitance of the system, it depends on physical dimensions of the conductors.
$$\large \textbf{(b) Derivation of Capacitance}$$
$$\textbf{Step 1: Electric field inside capacitor}$$
Let, $$\sigma = \cfrac QA$$ be the charge per unit area of both the plates.
The gap($$d$$) between plates is generally very small as compared to the Area($$A$$) of the plates.
So for calculating Electric Field inside, the plates can be assumed to be infinite.
So,
$$E_1=\dfrac{\sigma}{2\epsilon_0}$$ (Rightwards)
$$E_2=\dfrac{\sigma}{2\epsilon_0}$$ (Rightwards)
Therefore, Net Electric field in the air gap $$E_0=E_1+E_2=\dfrac{\sigma}{\epsilon_0}$$
Now, when a dielectric of dielectric constant $$K$$ is present between the plates.
So, Net electric field $$E_{net}=\cfrac {E_0}{K}=\dfrac{\sigma}{K\epsilon_0}$$
$$\textbf{Step 2: Potential diffrence between plates}$$
P.D. between plates (1) and (2)
$$V_{12}=E_{net}\times d=\dfrac{\sigma}{K\epsilon_0}\times d$$
However, $$\sigma =\dfrac{Q}{A}$$
So, $$V_{12}=\dfrac{Qd}{KA\epsilon_0}$$ $$....(1)$$
$$\textbf{Step 3: Capacitance of capacitor}$$
$$C=\dfrac{Q}{V}=\dfrac{Q}{Qd/KA\epsilon_0}=\dfrac{KA\epsilon_0}{d}$$ (from equation $$1$$)