Answer
When a pendulum is displaced from the equilibrium position, the gravitational force provides the restoring force toward the equilibrium position. The magnitude of the restoring force is proportional to the mass of the bob. It follows that the period is independent of the mass.
When a mass on a spring is displaced from the equilibrium position, the force of the spring provides the restoring force, At each position, the restoring depends on the spring but not on the mass. Then at each position, the acceleration of the larger mass will be smaller in magnitude than the acceleration of the smaller mass. Therefore, the period of a mass-spring system will depend on the mass.
Work Step by Step
When a pendulum is displaced from the equilibrium position, the gravitational force provides the restoring force toward the equilibrium position. The magnitude of the restoring force is proportional to the mass of the bob. At each position, since a larger mass will have a larger restoring force proportional to the mass, the magnitude of the acceleration of the bob at each position is the same for any mass. It follows that the period is independent of the mass.
When a mass on a spring is displaced from the equilibrium position, the force of the spring provides the restoring force, At each position, the restoring depends on the spring but not on the mass. At each position, a larger mass will have the same restoring force as a smaller mass. Then at each position, the acceleration of the larger mass will be smaller in magnitude than the acceleration of the smaller mass. Therefore, the period of a mass-spring system will depend on the mass.