I made a gif to try to explain how the three types of access (space, database and entity level) work.
I hope it makes sense.
Note: for the entity access, the depth of sharing (the blue boxes) depends up on the access template used. So it is possible to share only A2, or share A2, B1, B2 & B4, or share A2, B1, B2, B4, C1, C3 & C5