You first sacrifice some pins to talk to an I/O expander. e.g. you use the two I2C pins to connect to a MC23017. There are lots of tutorials how to do that, including software. That gives you 16 pins so now you have 14 pins more then before. In fact you can connect up to 8 of those giving you 128 pins.
But at a cost: you need to write some I2C software to control those pins, read and write them. That will be much slower that the other Arduino pins. Thus you use those MCP3017 pins for 'slower' signals.
The MCP3017 also ashas in interrupt out pin but to use that you have to sacrifice a third I/O pin of your Arduino. ButThe software for that is again a bit complex. Howevere it allows you to 'respond' to evens on the MCP3017 inputs.
The trick is to just 'play' with the I/O expander alone, until you understand how it works and have some code how to control it. Then add that to your robotics hardware and software.