Context: For the last month I noticed that my car (2003 Mazda 2 [DY], petrol) had some issues accelerating, especially between 2000 and 3000 rpm in lower gears. I had this before and it got fixed by replacing the spark plugs. Today I noticed that the circled hose in the picture was not connected. I assume it got loose since I often have to drive on rough cobblestone. I plugged it back in and immediately noticed that the acceleration issues were gone.
1) What is the purpose of that thing?
2) Do I need to check for eventual damages, or have it replaced/fastened?