IP is used to get network configuration details, ip is the current configuration tool. ifconfig is also used to fetch network configuration details but this older command has been used in many versions of Unix for decades but is less capable as compared to ip. Certain distribuitions don't even include if config by default.
The ip command is a modern and more versatile network configuration tool compared to the older ifconfig command. It provides a broader set of functionalities for configuring and managing network. Command ip is more consistent across different Linux distributions and is the preferred choice for modern network setups.