The first link JimP gave you is very useful but does not have anything to do with headers and footers.
Look here:
Header/Footer Settings Recap
Headers and footers are a creature or part of Sections. Each section has three of each even if you only see one. Headers and footers in each section after the first can be linked to (the immediately) previous header/footer of the same type.
Note that you can make dramatic apparent changes in headers and footers without having a different header footer using fields. The most apparent of these is the page field which gives you page numbers, however a very useful but often overlooked one is the
StyleRef Field. It lets the header or footer update according to information in the body of the document.