For a system of equations in matrix form $AX=B$,
If $|A|\neq0$, there exists a unique solution $X=A^{-1}B$.
That is fine i understand this.
If $|A|=0$,
Case 1: $(\operatorname{adj} A)\cdot B\neq O$,
then solution does not exist and the system of equations is called inconsistent.
Case 2: $(\operatorname{adj} A)\cdot B=O$,
then system may be either consistent or inconsistent according as the system have either infinitely many solutions or no solution.
How does $(\operatorname{adj} A)\cdot B$ comes into the problem and how does the case 1 and 2 statements emerge ?
You have $(\operatorname{adj}\,A)\,A=|A|$. When you multiply $Ax=b$ by $\operatorname{adj}\,A$, you get $$ |A|=(\operatorname{adj}\,A)\,b. $$ If $|A|=0$, you need the right-hand-side to be zero.