When the horse exerts a force on the cart,the cart gets subjected to four forcesin all i.e the gravitational force,normal reaction offered by the ground,the external force exerted by the horse on the cart and the frictional force offered by the ground.the first two forces balance each other and hence play no role in motion of the cart.However,the external force exerted by by the horse is partly balanced by the frictional force but the remaining unbalance force causes motion of the cart.