If matter and antimatter annihilate each other, why is the pentaquark stable since quarks are matter and the antiquark is antimatter?
It depends on whether or not the system corresponds to a $SU (3) $ singlet representation (a one dimensional irreducible representation). This is the color confinement postulate: (here somewhat sloppily) particles we can observe are in a singlet of $SU (3) $.
You can show by tensorial decomposition that the mesons and the baryons contain a singlet representation of $SU (3)$, the pentaquark should too. I once tried to do the math but did not end the computation.
Now I don't have phenomenological knowledge of the lifetime of the pentaquark and this could be a relevant reason as for why color confinement should not apply in the pentaq case.