You need to understand the difference between entropy change and entropy generation.
As @Wolfram jonny pointed out for a reversible isothermal process there is an overall change in entropy (system + surroundings) of zero. The entropy lost/gained by the system exactly equals the entropy gained/lost by the surroundings.
For an irreversible process entropy is generated in the system. To return the system to its original state (complete a cycle) that entropy has to be transferred to the surroundings. The only way to transfer entropy is by heat transfer.
This is what happens in the case of the free expansion of an ideal gas. Take a perfectly insulated rigid vessel with a partition in between. In one half is an ideal gas. In the other half a vacuum. An opening is made in the partition so that the ideal gas expands into the evacuated half of the vessel. Since the vessel is rigid and perfectly insulated, the system is isolated from the surroundings and there is no heat or work crossing the boundary. There is no change in the internal energy of the system and, for an ideal gas, no change in temperature, $T$.
However, the free expansion is clearly an irreversible process. The gas will not spontaneously return to its original half of the vessel. Therefore, entropy has been generated in the system. Since the system is isolated from the surroundings, there is no entropy change in the surroundings. To return the system to its original state, the entropy generated within the system during the irreversible expansion has to be transferred to the surroundings. In order to calculate the entropy generated in the system during the expansion, a convenient process is a reversible isothermal compression. This process transfers the entropy $\frac{Q}{T}$, which was generated in the system, out of the system and to the surroundings, returning the system to its original state.
Overall for the irreversible cycle we have:
$$\Delta S_{sys}=0$$
$$\Delta S_{sur}=+\frac{Q}{T}$$
$$\Delta S_{univ}=\Delta S_{sys}+\Delta S_{sur}= +\frac{Q}{T}$$
Hope this helps.