I installed a smart dimmer switch that requires a neutral wire. It was in the junction box with the two ends wire-capped together.
My switch didn't come with pigtail wires and I didn't have any extra wire lying around, so I couldn't do the recommended approach (install a third pigtail wire coming out of the neutral wirecap, and connect that to my switch's neutral terminal).
Instead, I just connected the two ends of the neutral wire by putting them into the same neutral terminal on the switch, under the same screw (see photo). The switch appears to work normally.
But some quick Googling around says I should never put two wires into the same terminal. Why is this? Is there anything dangerous about my approach? To me it seems logically equivalent to the pigtail approach, i.e. the current still has the same paths to flow through. What am I missing?
EDIT: adding two photos of the back of my junction box since some people asked. I know it's a little hard to see, but there are two bundles of cords entering from two ports at the top of the junction box. The bundle on the left has three wires: black, white, and unshielded copper. The bundle on the right has four wires: black, red, white, and unshielded copper. Before I installed my new smart switch, the two white (neutral) wires were connected together with a wirecap. Thank you for the help!