The meaning of middle-ware depends on the context where you want to use it. In general, it is some logic between two processes.
Here are two real world examples:-
1.) Express => When using express, we can use middle-ware between the request and response cycle. Using app.use(<some middle-ware>) you can instruct express to pass the coming request to go through some logic / function before being handled next to some other function and thus you can chain these middle-wares before passing some response.
2.) Redux => Redux also uses middle-ware extensively but instead of it being used between request - response cycle, Redux uses middle-ware after the action is dispatched and before it reaches the store to be processed by the reducers. The redux-thunk library is one of the popular middle-ware being used with Redux.
So in short, middle-ware is a diversion when we go from point A to Point B but through the middle-ware path.