To implement context aware configuration, you will have to set sling:configRef property to every parent nodes of your content tree so that all the nodes under the tree will become a context and the configuration will be applied to it
if you have multi locale site and you need to apply site specific configuration, in this case you will have to add sling:configRef property to all site root node respectively. This is where the problem was (in my case) and it was solved with the help of context path strategy. It means the context path strategy is something which will help you to implement context aware configuration without setting the property to every nodes of your content tree.
Read the whole blog at https://aemhelper.blogspot.com/2024/10/context-aware-configuration-context.html