وسبب وجوب الصوم شهود الشهر
The cause of obligatory fasting is witnessing, or being present in, the month.
فمن شهد منكم الشهر فليصمه
Whoever among you witnesses the month should fast it.
Ramadan is the legally identified occasion of the fasting obligation, while illness, travel and other excuses affect performance. The period's relation to fasting is not identical in every detail to a daily prayer period.
“Witnessing the month” is a legal notion of being present during the prescribed month; it does not make individual naked-eye observation of the moon the only conceivable way the rule can apply.