To improve speed, the operating system doesn't necessarily write things to disk (or a USB stick) straight away because that is quite slow. What happens is it keeps the data in RAM and it eventually gets written to the disk.
Safely ejecting the USB stick means the operating system makes sure that all the data has been written to the disk and then tells you it is safe to remove it. If you just pull the stick out, you might lose some of the data and it might corrupt the file system on the stick as a result.
Having said that, it's very rare to corrupt a USB stick by pulling it out before you have safely ejected it. You are quite unlucky.
You can fix it by running the disk repair tool on it. You can stop it from happening again by always telling the computer to safely remove the stick before pulling it out. This is done via an icon is the system tray.