The physics
One block sits on another. Only friction links them. Static friction gives each block the push it needs. But it has a limit, μm₁g.
friction between the blocks: f ≤ μ m₁ g
Find the block that only friction moves. Its largest acceleration is the limit for both blocks.
pull the bottom: a ≤ μ g pull the top: a ≤ μ m₁ g / m₂
Past the limit, the top block slips. Friction then stays at μm₁g. Use F = ma for each block on its own.
A rough floor pulls the bottom block back. The floor holds up both blocks. So its friction is μf (m₁ + m₂) g.