Ibn Abbas explained the following Qur'anic verse: "O ye who believe! fasting is prescribed for you as it was prescribed for those before you" During the lifetime of the Prophet ﷺ, when the people offered night prayer, they were asked to abstain from food and drink and (intercourse with) women, they kept fast till the next night. A man betrayed himself and had intercourse with his wife after he had offered the night prayer, and he did not break his fast. So Allah, the Exalted, intended to make it (fasting) easy for those who survived, thus providing a concession and utility. Allah, the Glorified, said: "Allah knoweth what ye used to do secretly among yourselves." By this Allah benefited the people and provided concession and ease to them.
عَنِ ابْنِ عَبَّاسٍ { يَا أَيُّهَا الَّذِينَ آمَنُوا كُتِبَ عَلَيْكُمُ الصِّيَامُ كَمَا كُتِبَ عَلَى الَّذِينَ مِنْ قَبْلِكُمْ } فَكَانَ النَّاسُ عَلَى عَهْدِ النَّبِيِّ ﷺ إِذَا صَلَّوُا الْعَتَمَةَ حَرُمَ عَلَيْهِمُ الطَّعَامُ وَالشَّرَابُ وَالنِّسَاءُ وَصَامُوا إِلَى الْقَابِلَةِ فَاخْتَانَ رَجُلٌ نَفْسَهُ فَجَامَعَ امْرَأَتَهُ وَقَدْ صَلَّى الْعِشَاءَ وَلَمْ يُفْطِرْ فَأَرَادَ اللَّهُ ﷻ أَنْ يَجْعَلَ ذَلِكَ يُسْرًا لِمَنْ بَقِيَ وَرُخْصَةً وَمَنْفَعَةً فَقَالَ سُبْحَانَهُ { عَلِمَ اللَّهُ أَنَّكُمْ كُنْتُمْ تَخْتَانُونَ أَنْفُسَكُمْ } وَكَانَ هَذَا مِمَّا نَفَعَ اللَّهُ بِهِ النَّاسَ وَرَخَّصَ لَهُمْ وَيَسَّرَ