Pixel density is the number of pixels per length, not area: see
https://en.wikipedia.org/wiki/Pixel_density; https://www.definitions.net/definition/pixel+density etc etc. A 30 Mpx APS-C sensor has only a 33% greater pixel density than a 17 Mpx sensor. It's not a pedantic distinction, it is crucial for telling you how much longer a telephoto lens you need to get similar reach (resolution). If the pixel density was double, you would need a 600mm lens on the 17 Mpx sensor to give about the same resolution as a 300mm on the 30 Mpx, but with a 33% difference only an approximately 400mm lens on the 17 Mpx is needed.
Density is a vague term that can refer to linear, area, or volume. Volume density isn't really relevant to photographic sensors, but it's the one we experience often in our everyday lives. Remember science class in school: A bowling ball sinks in water because the ball is more dense than the water (which is actually a lazy explanation; the ball sinks because its weight--the influence of gravity on its mass--is greater than that of the water that it displaces. But I digress...)
The crop factor of a sensor is related to its linear dimensions and affects the angle of view. The same lens on a full frame camera will have 1.6x the angle of view as it will on an APS-C camera (that's for Canon. It's 1.5x for Sony, Nikon, Fuji, etc.). Usually this is thought of the opposite way: The same lens on an APS-C camera will give the same FOV as a lens with 1.6x the focal length on a FF camera.
When comparing linear pixel density between sensors, what matters is actually the pixel size, or pitch. The EOS R3 and 80D are both 24 effective MP cameras that produce images 6000 x 4000 pixels. So the pixels on the R3 must be 1.6x wider and 1.6x higher (or 2.65x the area) than pixels on the 80D.
When you use a FF R camera in crop mode, it crops the native images by 1.6x horizontally and by 1.6x vertically. So for the R5, whose maximum image size is 8192x5464, a cropped image is nominally (8192/1.6 = ) 5120 x (5464/1.6 = ) 3415, or approximately 17.48 MP. And the total 45MP of the full-frame R5 has been divided by (1.6)^2, or 2.56.
(I said "nominally" in that previous paragraph because I don't have an R5 and I don't know exactly what size images it produces in crop mode. There may be reasons why it is smaller or larger than this, and I'm confident lots of people will tell me if that's not correct).
The thing about crop factor is that it's solely a property of the sensor. Nothing about the optical properties of the lens changes. A 600mm lens is still a 600mm lens, and it produces the same image regardless of the size of the sensor behind it.
This leads to why many people who photograph small distant objects prefer APS-C. Say you're photographing something small and distant with that 600mm lens I mentioned earlier. And suppose the lens produces an image on the sensor where the small distant object is 1mm wide by 1mm high. That 1mm x 1mm is determined by the object's size, distance, and the 600mm lens. The sensor doesn't change it. What the sensor's "pixel density" affects is how many pixels will be "underneath" the image of that object. If you're shooting with an R3, the image of the object will cover an area of about 167 pixels wide by 167 pixels high on your sensor. If you're instead using the 80D, the smaller pixels (1/1.6x the R3 pixels in both dimensions) mean your 1mm x 1mm object will cover an area of about 1.6x x 1.6x as many pixels, or about 267 wide by 267 high on the APS-C sensor.
I used the R3 and 80D in these examples because they are both 24MP cameras that produce 6000 x 4000 images. The math gets a little more complicated when you compare different size sensors with different MP's. For example, the R5 and the 90D. Then the crop factor still determines the total relative fields of view, but it's less meaningful for determining the number of pixels on your subject because you need to take into account the actual pixel sizes of the two sensors.