Differences between Strapi middleware and plugin

What are the differences between a middleware and a plugin in Strapi? I would like to know the different purposes of these two.

My goal is to implement External API’s within Strapi. So therefore I would like the know what’s the best location for implementing within the Strapi architecture.