There are different reasons why an antenna engineer adds slots to a patch antenna. One reason is to make the patch resonance at a new frequency, such as a dual band patch. In this case a slot is added to the patch in a way that the RF signal has two paths to travel into. Making one path shorter or longer will create a new resonance higher or lower in frequency.
A slot could also be added to adjust the antenna impedance if the antenna impedance is far from the cable impedance and the reflection loss is to large. I.e. transmitted power by the PA does not enter the antenna but is reflected back to the transmitter instead.
A third reason is mechanical. Patch antennas are sometimes folded or bent. Making a slot can make it easier to manufacture and bent.
Slots creates multiple resonance, as it is obstruction and media change as far as Signal travel is concern. Hence, to change the impedance and to widen the bandwidth (multiple resonance point will widen the BW) slots are created
Slots are mainly created to have new resonance frequency. When they are placed at the bottom layers, the gain of the antenna will increase. In more of the cases, if slots are done on the patch, the gain will decreases in cost of additional resonance due to the metallic diminution.