We consider the formalism of information decomposition of target effects from multisource interactions, i.e., the problem of defining redundant and synergistic components of the information that a set of source variables provides about a target, and apply it to the two-dimensional Ising model as a paradigm of a critically transitioning system. Intuitively, synergy is the information about the target variable that is uniquely obtained by taking the sources together, but not considering them alone; redundancy is the information which is shared by the sources. To disentangle the components of the information both at the static level and at the dynamical one, the decomposition is applied respectively to the mutual information and to the transfer entropy between a given spin, target, and a pair of neighboring spins (taken as the drivers). We show that a key signature of an impending phase transition (approached from the disordered size) is the fact that the synergy peaks in the disordered phase, both in the static and in the dynamic case: The synergy can thus be considered a precursor of the transition. The redundancy, instead, reaches its maximum at the critical temperature. The peak of the synergy of the transfer entropy is far more pronounced than those of the static mutual information. We show that these results are robust with respect to the details of the information decomposition approach, as we find the same results using two different methods; moreover, with respect to previous literature rooted in the notion of global transfer entropy, our results demonstrate that considering as few as three variables is sufficient to construct a precursor of the transition, and provide a paradigm for the investigation of a variety of systems prone to crisis, such as financial markets, social media, or epileptic seizures.