Here are some comments on the question.

We know in the described situation we can meet two
rιgimes: the block M is not slipping
along the block m; or it is slipping.
In order to investigate the total situation we have to start
from the most common picture, like the given one. In general, we need to
consider the following:
F is the force acting on the block m from the spring.
Fcf is the force of kinetic friction acting on
the block m from the surface.
Nm is the normal force form the surface to the
block m.
If μ is the coefficient of the kinetic friction between
the block m and the surface, Fcf
= μ Nm.
Fsf is the force of static friction (until the
mass M starts slipping) acting on the mass m from the mass M.
F/sf - is the force of static friction (until the
mass M starts slipping) acting on the mass M from the mass m (By the 3rd NL it is connected to Fsf, but
until the body M starts slipping there is no connection between F/sf
and NM).
Mg and mg are forces of gravity acting on the bodies.
NM is the normal force acting form the body m to
the body M.
WM is the weight of the body M, i.e. the force
acting on the body m from the body M (By the 3rd NL it is connected to NM).
am and aM are the accelerations of
the bodies.
Now we can this force inventory for the situation to write
the 2nd NL for both objects (in components to the horizontal and
vertical axes).
For the mass m:
F Fcf Fsf = m am mg + WM
Nm = 0
For the mass M:
F/sf = M aM Mg - NM = 0
The 3rd
Fsf = F/sf and
WM = NM
Plus, we can add the definition of the μ; Fcf = μ Nm.
If μM is a coefficient of kinetic friction
between the body M and the body m, there is no slipping until F/sf
≤ μMNM
(of course, we can solve this condition for F, for example).
In this case we can take aM = am = a
and get two equations:
F - μ Nm = Mt a and Mtg Nm = 0
which are just the equations of the motion of a body with the
total mass of Mt = M + m.
So, when there is no slipping, we can treat the system as a
single body with the mass of M+m. In the case of the motion with a constant
velocity we have a = 0 and get the solution for the coefficient of friction

This formula (or similar) is using in many Physics labs on
friction.
And we know for sure that the only reason for the body M gets
moved is the force of friction acting from the body m on it (without friction
between the bodies we would just moved out the body m from under the body M).
But let us go back to the very beginning of our reasoning to
the equation F/sf = M aM. When the body is moving with the constant
velocity aM = 0, and the force of friction disappears (hence, there
is no force of fiction on the free body diagram)!
Are you agree?