The essence of the Fiat-Shamir transform is to ensure that the value of a challenge cannot be known prior to the prover committing to a certain value. If the challenge is provided first, then anyone can forge a signature, and so the signature is deniable.
For an interactive proof, if a verifier cannot prove that they sent a random challenge prior to receiving the response, then the prover can deny that they knew the private key and can therefore deny they provided the signature.
In contrast, if it were a non-interactive proof, the way in which the challenge is calculated will prove that it could not have been known prior to the response value being calculated.
For example, an interactive EC Schnorr proof would involve the prover picking a blinding factor $a$, providing the commitment $A=aG$ to the verifier, and receiving a challenge $c$.
The prover then sends the response $r=a-cx$ for the public key $X=xG$, and the verifier checks that $A\overset{?}{=}rG+cX$.
If the verifier sent the challenge $c$ prior to receiving the commitment $A$, then someone without knowledge of the private key $x$ could just pick a random response $r$ and calculate the value $A=rG+cX$.
Therefore, the verifier cannot produce the values $A$, $c$ and $r$ as proof to a third party that the signature is valid, unless they can prove they only sent $c$ after $A$ was received.
However, with a non-interactive EC Schnorr proof, $c=H(m\mathbin\| aG)$, and the response, as before, is $r=a-cx$.
This means that $c=H(m\mathbin\| aG)=H(m\mathbin\| rG+cP)$. If the prover chose $a$ first, then they would not have control over $c$ and could not produce a valid value of $r$ without knowledge of the private key. Similarly, if the prover chose $r$ first, they could not have produced a valid value of $A$ without knowledge of the private key. Either way, the prover would have had to have chosen an $a$ or $r$ value prior to discovering the value of the challenge $c$, which means they must have known the private key in order to produce the signature $(A, r)$.