I don't think that's quite right - Q-Celtic didn't change p to c.
Proto-Celtic is thought to have changed Proto-Indo-European p to an "f"-like sound, which was deleted, like how Latin faba became Spanish haba, so the ancestor of the surviving Celtic languages had no p sound.
So PIE ph₂tḗr > PC ɸatīr > Old Irish athir > Modern Irish athair
P-Celtic languages got the p sound back by changing kʷ and gʷ to p and b. This leads to: PC makʷos > Welsh mab (p is lenited to b in Welsh).
Q-Celtic merged kʷ and gʷ with k and g. makʷos would be expected to give -mach-, as c is lenited to ch in Irish. This means mac would come from a local makkʷos pronunciation. It also means Q-Celtic still had no p, so couldn't have changed p to c.
Early Irish that was still close to early Welsh, so speakers might have noticed Welsh p matched with their k. So Pasg was reshaped as Cáisc. It doesn't look like you can infer a general rule from this though - Padrig became Pádraig rather than Cádraig.
Even today, nearly all words with beginning with p in Irish are loanwords.
Thanks for correcting me. I didn’t express myself clearly enough and I’ve amended the post accordingly.
Yes, Indo-European p did not become Old Irish c. The p was often lost, as in the case of athair or mutated, I think, into a /b/ or /x/.
Where Old Irish borrowed words from Latin (sometimes via Welsh, or I guess Brittonic at the time) we do sometimes see a p > c change. I think this may be the case with Latin presbyter ‘priest’ > Old Irish cruimther ‘priest’ or planta ‘shoot, plant’ > cland ‘offspring’.
Not all loanwords show such a sound change e.g. Old Irish penn ‘pen’ from Latin penna ‘feather’. Patrick is an interesting case because Irish adopted the p spelling but I’m pretty sure you get something like Cothrige in some early texts. I’d have to double-check.