The distinction is in the placement of the brackets, and the operator precedence.
$\exists x\in X~\Big(P(x)\to\forall y\in X~P(y)\Big)$
This states: "There is something in $X$ where if that thing satisfies $P$, then everything in $X$ satisfies $P$". Now, implications are only false when their antecedent is true and consequent false. However, when the consequent is false, then there is something in $X$ that makes the antecedent false too.
So you can always find something in $X$ that makes the implication hold (well, unless there is no things in $X$).
So, as long as $X$ is not empty, this existential statement is true.
Because implication has precedance over quantification, there is implicit brackettng around the existential in the antecedant.
$\Big(\exists x\in X~P(x)\Big)\to\forall y\in X~P(y)$
This states "If there is something in $X$ that satisfies $P$, then everything in $X$ will satisfy $P$."
It is possible to have an $X$ and $P$ that make this implication false.