[Machine] The prayer of two units (Rak'ahs) has been prescribed in Mecca. But when the Messenger of Allah ﷺ arrived in Medina, he added two more units to each two units of prayer, except for the Maghrib prayer, as it is the odd prayer of the day. And the Fajr prayer is lengthy in recitation. He also said that when he used to travel, he would pray the first prayer.
قَدْ فُرِضَتِ الصَّلَاةُ رَكْعَتَيْنِ رَكْعَتَيْنِ بِمَكَّةَ فَلَمَّا قَدِمَ رَسُولُ اللهِ ﷺ الْمَدِينَةَ زَادَ مَعَ كُلِّ رَكْعَتَيْنِ رَكْعَتَيْنِ إِلَّا الْمَغْرِبَ فَإِنَّهَا وِتْرُ النَّهَارِ وَصَلَاةَ الْفَجْرِ لِطُولِ قِرَاءَتِهِا قَالَ وَكَانَ إِذَا سَافَرَ صَلَّى الصَّلَاةَ الْأُولَى