‘w’ for winter
oil is like Crisco cooking grease
When it is cold it is thick (the larger number on the oil)
When it heats up it thins out (the smaller number on the oil)
5W-30 is an all season oil .
From snowy climates to desert climates.
Motor oils are rated in terms of viscosity. The oils you cite are what are called multi-viscosity oils. That is, their viscosity character changes in a non-linear way with temperature.
Single viscosity oils thin as they get hotter, thicken as they get colder. A common oil some years ago ws 30 weight. In fact, simple power tools (lawnmowers) often still suggest such oils, they work well when air temperatures are stable such as in the summer.
Multi-viscosity oils have the properties of the first number when cold (below 30degF) and the properties o the second number when hot (say abouve 100degF). These oils enable better winter operation, fuel economy and engine durability.
So, a 10weight oil is thicker than is a 5 weight oil. You need to read your owners manual carefully as the oil you use is very important.. Generally, modern cars like 5W30 year round. Older cars had larger bearing clearances and actually required the heavier 10W30 or 10W40 oils though, so check.