Once your Mac is connected to a private network in a home or office, then it’s probably delegated what’s called a dynamic IP address. (To check, see How to Locate Your Mac’s IP Address.) That is not a problem for the majority of users. Most people don’t care if their IP addresses vary or perhaps not.
But lively IP addresses won’t benefit several tasks such as port forwarding, dynamic DNS, or even client-to-client file sharing on the regional network. For all those unique scenarios and others, only a static IP address will do the job. Setting a static ip in Mac-OS will create an enduring, private IP address for the Mac, which will not switch from one day to the next.
Other apparatus attached to your local network will be able to gain access to your Mac. If you install port forwarding, then certain services running on your Mac will probably be accessible to the outside world.