First of all, you need to understand what are ions.
Ions are simply atoms with a net electric charge on them.
Eg- H+, Cl-
Polyatomic ions are a group of atoms containing a net electric charge.
Eg - NH+, OH-
Here, NH+ and OH- contain two atoms (or a group of atoms) each.
For formation of compounds with polyatomic ions, the ion is enclosed in a bracket to indicate the ratio.
Let me explain it with the help of an example.
Mg3(PO4)2 - Magnesium Phosphate
Here, a compound is made using Phosphate (PO4), which is polyatomic ion.
Since Mg has a valency 2 and PO4 has a valency 3, therefore we get the formula Mg3(PO4)2 by criss-cross method.
Phosphate here is a polyatomic ion and so we enclose it in a bracket to indicate its ratio, i.e, 2