Welcome,
You have some interesting questions! You touch on areas of active research and there are quite a few different hypotheses about this stuff.
One reason for confusion is that different parts of the brain are doing different things. For a brief primer I recommend the article: “What are the computations of the cerebellum, the basal ganglia and the cerebral cortex?” by K. Doya, 1999, link to free copy: http://gashler.com/mike/courses/nn/r3/doya1999.pdf
Numenta and their “HTM” theory describe the basic principles of the neural code.
Here are some good references on the topic:
-
“Properties of Sparse Distributed Representations and their Application to Hierarchical Temporal Memory”
Subutai Ahmad and Jeff Hawkins (2015)
Link: https://doi.org/10.48550/arXiv.1503.07469
This article formally introduces the SDR concept and the related equations -
“HTM School”
Matt Taylor (2016)
Link: https://www.youtube.com/playlist?list=PL3yXMgtrZmDqhsFQzwUC9V8MeeVOQ7eZ9
A good introduction to computational neuroscience, covers this material in laymans terms -
“The Representation of Information in the Brain”
Link: https://youtu.be/AWRheJZ_m9A
My own very silly explanation of this topic
One hypothesis about the cerebral cortex is that the neuron activity encodes two things: the categorical information and the level of attention that you should pay to that information. The literal information is encoded by the neurons that spike at least once, and the attention signal is encoded by the number additional spikes in the spike train. In this scheme, the things that you’re paying attention to are a subset of all the things you’re seeing.
We discussed the details of this hypothesis in the thread: L5tt cells are attentional (paper summaries)
I hope this helps!