This question came up in the Online 10-day Retreat Nov 3, 2020, guided by Delson Armstrong. Day 6 was part of a daily 30-minute discussion on the suttas, the Dhamma talk and reflections.
Slightly edited to improve readability
In the case of rebirth, on the macro level, one consciousness links into another Mentality-Materiality at the point of death, at the very deep layers of mind.
You might have heard of people that have had near-death experiences, or things like that. It's happening in the mind, in the Mentality of the Mentality-Materiality. What's happening is that the Formations are arising and producing these experiences. So then, that consciousness attaches to it through craving, clinging, and identifying. This happens with intention.
In the case of one who is experiencing death, there will be memories that arise, there will be other images that arise, and these are all different Formations coming to fruition. They're coming into the mind's eye, if you will, in the way of images, as I just said. Then, if any part of the mind attaches craving to it, attaches that sense of Ignorance that there's a self here, then - through intention of attaching to that Formation - there is a new consciousness that arises. This spontaneously links with a new Mentality-Materiality, at the point of conception. That consciousness drives forward all the Formations that it attaches to. Those Formations will be at the foreground of that birth, so it will manifest in the form of a birth, related to those kinds of Formations.
This is why, when someone is dying, it's important to keep them in a state of comfort, to keep them in a state of good feelings, good Formations, and good thoughts and experiences. Because that can relate to a better rebirth, or better circumstances for better rebirth.
Having said that, that does not mean that there are certain Formations related to negative experiences or negative Kamma that won't come to fruition. They will still manifest, even if you have a ‘positive’ birth, or better circumstances.
On the flipside, if you are in a negative situation and you have a negative birth, so to speak, there will still be the seeds of the positive Formations that will still take root through the experiences that you have.
So, it's not necessarily completely black and white. But what I’m saying is, to simplify, when at the point of death, you see these experiences; if there is clinging to them, if there is attachment to them, if there's identification to them, the intention to attach to them drives forward the Consciousness. It transfers all those Formations and links spontaneously through that process of rebirth, to a new Mentality-Materiality, at the point of conception. That creates the rest of the links of Dependent Origination, on the macro level. In the case of a human birth, that consciousness dissipates, and more consciousnesses arise within the development of that fetus, in the womb. And then, of course, the physical birth happens for that being.