Distributive property of division over addition and logic
The way I think about it is that the notation $x/y$ is "defined conditionally" with the condition $y\ne0$. This means whenever we use this notation, it must be clear that $y\ne0$ or that the value of the expression $x/y$ ultimately doesn't affect the value of some surrounding expression in the case $y=0$. (Technically we might define $x/0$ to be some dummy value like the empty set, if we're using a formal system that requires this.)
This is the case in your examples because if $P$ is false, then $P\implies Q$ is true regardless of $Q$, and if $Q$ is true, then $P\implies Q$ is true regardless of $P$.