Pre-Registration and Pre-Analysis Plans

What are pre-analysis plans and how does pre-registration benefit the scientific community, as well as our own research?