Considering how you are explaining .enter() and .exit() It seems to me d3 choose some odd names. I think it would help us if we knew why the library author(s) named them 'enter' and 'exit'. I suspect it's an implementation detail in the library (which IMO they should not have exposed as the public-facing API naming convention).
To me, it seems like 'enter' is for the data that is 'entering' the dataset - as in 'coming into' the data for the first time. Exit is the same - it is the data that is 'exiting' the dataset - as in leaving.
It would be great if you put link to github repositories or even right the gitpod links into description - so everybody can have ready development workspace in a minute and follow you hands on code