Do counterfactuals have something to do with learning from negative examples and simulations? For example, if one shoots a ball and misses the goal to the right, one does not 'mindlessly' penalize the circuits that led to the exact motor decisions that were involved, but instead, one simulates alternative actions and uses e.g. (in this case linear) relationships between e.g. the angle of the foot or the wind speed and the shooting direction. The next time, one hence tries to aim slightly to the left.
Or are you referring to a much more fundamental level and my example might rather be a learning strategy that is more likely acquired by trial & error, reinforcement learning, meta learning ("learning how to learn") and/or via the shared concept space of language and culture?
Is it maybe related to e.g. prototype-based associative recall and a counterfactual is basically an alternative way of interpreting the data? "What error signal would I get, if I had interpreted X as Y?"
Or does it come from the Bayesian approach where you marginalize out all hypotheses, including the factual one that corresponds to the state of the world, but also all counterfactual hypotheses. So, including counterfactuals means going beyond the maximum likelihood point estimate e.g. by communicating confidence intervals or even entire distributions from neurons to neurons or neuron populations to other neuron populations?