Velocity depends on both magnitude and direction because it is a vector quantity. In physics, vectors are quantities that have both magnitude and direction. When describing the motion of an object, it's not enough to know how fast it's moving (magnitude or speed); we also need to know the direction in which it's moving.
Consider two objects moving at the same speed, say 10 meters per second. However, if one object is moving to the east and the other is moving to the west, they have different velocities. The magnitude of their velocities is the same (10 m/s), but their directions are opposite.
By including direction in the definition of velocity, we gain a more complete understanding of an object's motion. Velocity allows us to differentiate between different paths, orientations, and changes in position over time. It provides a comprehensive description of how an object is moving, taking into account both its speed and the direction of that motion.