For the sake of everyone here, I'm going to try write the series storylines, both with and without FNaF4, just to show you how many changes this game made.
Spoiler: FNaF1-3 without 4 (click to see content)
Pre-Games: At some point in time, Fredbears Family Diner is in existence with two animatronics: a golden bear (Fredbear, later "Golden Freddy") and a golden rabbit. It gets bought out by Fazbear Entertainment and is renamed Freddy Fazbear's Pizza. Secret development on hybrid animatronic/costume suits is developed, but are abandoned and the suits are sealed up when suit malfunctions go horribly wrong with the Bonnie suit (Springtrap). The original bear and rabbit animatronics are replaced with Freddy and Bonnie, and Chica and Foxy are added. Purple Guy murders a kid here in secret, restaurant gets shut down.
FNaF2: In 1987, a new Freddy Fazbear's Pizza is opened up with new animatronics with the ability to walk around and detect child predators (The Toys, Mangle, and presumably The Puppet and Balloon Boy). The chain originally attempted to outfit the old animatronics with this technology but failed so they just keep them around for parts (what the fans called "The Withereds"). Purple Guy gets a job working as the Night Security Guard, but complains about the animatronics walking around at night so he gets transferred to the day shift while Jeremy Fitzgerald becomes the new Night Guard. As Day Guard, Purple Guy steals the original Fredbear costume out of Parts and murders five children. The Puppet (which contains the housed spirit of the first murdered child) places the dead children into the old animatronics in hopes of bringing them back to life. The Toy animatronics presumably witnessed these murders, and become suspicious of all the staff members (Phone Guy tells you to avoid eye contact with them). The police start an investigation, and Purple Guy is fired and not allowed to get back in the building, so Jeremy Fitzgerald becomes the new Day Security Guard. The restaurant is going to be temporarily closed for the investigation after one more party which Jeremy is told to supervise (he gets told this while accidentally doing a night shift on Night 6) and protect patrons from getting killed. The Bite of '87 occurs, and while specifics are vague, it's safe to assume that a Toy Animatronic did this and the victim was Jeremy Fitzgerald, as the security guard on Night 7 (after the party) is Fritz Smith (who is fired after one night). The restaurant gets shut down after only one week in business. The bite is blamed on malfunctioning toy animatronics causing the bite, and they are all scrapped. The old animatronics (the ones with the dead kids inside them) are saved for a future restructuring.
FNaF1: Restaurant reopens in 1993 (this was deduced by calculating minimum wage payments over several years and matching that up with the paycheck on Night 5) with a much smaller budget (hence the limited electricity). Phone Guy is the Night Guard. The old animatronics are continuously trying to kill him, so he leaves a set of messages for the next night guard, Mike Schmidt. Phone Guy gets killed. During Mike Schmidt's stay, patrons are noticing that the animatronics have traces of blood and mucus coming out of the suit, and move like "reanimated carcasses." Mike Schmidt gets fired after tampering with the animatronics in hopes of saving his life, as the animatronics start trying to kill him, too. The assumption is that the animatronics are attacking the night security guards because they only remember that their murderer was a security guard. Eventually, poor business due to the stigma from the place combined with investigations from the health department close down the restaurant for good.
Somewhere in the 30 years between FNaF1 and FNaF3: Purple Guy returns to the abandoned restaurant and dismantles the old animatronics. This releases the ghosts of the children in the suit and they scare him into the Springtrap suit that activates due to the moisture in the restaurant from the rain as well as his laughter, and he is crushed inside the suit and killed. Most of the history of the chain starts fading from public memory.
FNaF3: In 2023, a theme park has been scavenging stuff from the closed restaurant and opens a haunted house attraction based on the events in the chain (which are now considered to be merely stories). At some point, they find the Springtrap suit and install it in the attraction. This accidentally causes the five ghost kids to be dragged along with him, and they now also haunt the attraction (The Phantoms). The unnamed security guard is able to piece the story together and put the souls of the dead children to rest. To avoid any more problems, he sets the attraction on fire destroying most of the assets. Springtrap's fate is ambiguous, although it's hinted that he's somewhere loose in the world.
And now I'll try to redo the plot with what happened in FNaF4!
Spoiler: FNaF1-4 UGH (click to see content)
FNaF4: It's 1987. Purple Guy's child is constantly bullied by his older brother and his peers. His only friends are the Fredbear mascots (who include Freddy, Foxy, Bonnie, Chica, and... Fredbear. Yes, Fredbear and Freddy are two different entities. Why Fredbear would have two nearly identical characters with slightly different colors be different characters is never explained). Every night for five nights, he has nightmares of these mascots attacking him (along with a plush of Springtrap and a Nightmare version of Fredbear). On his birthday, five kids bully him by shoving him into a singing Fredbear's mouth, and it accidentally bites off the kid's frontal lobe, causing The Bite of '87. The child still lives but is realistically probably a vegetable.
Before FNaF2: Purple Guy kills a lonely child watching Fredbear from outside a building for who knows what reason. Fredbear's closes down. Freddy Fazbear's Pizza opens up in its place, and Fredbear is probably retired due to the bite, and Freddy becomes the new mascot, and is now joined by Chica, Bonnie, and Foxy. Despite retiring Fredbear, however, the Fazbear entertainment attempts to make a Fredbear Suit and a Bonnie Suit, but both are scrapped when the Bonnie Suit malfunctions. They end up closing too for some reason (it's not for the suit incident because it happens and nothing changes in the restaurant according to the tapes on FNaF3 except for the employees wearing shitty normal costumes).
FNaF2: Mere months after the original Fredbear's opened, Freddy Fazbear's Pizza opens up again. The same stuff happens with Purple Guy stealing the suit and murdering the five kids, and the sixth kid trying to save them, toys act up (but nothing comes of it), Purple Guy gets kicked out, police investigate, blahblahblah. The restaurant has to temporarily close, but there's one more birthday party where Jeremy Fitzgerald supervises and it apparently goes off without a hitch. Police find nothing, but the restaurant decides to shut down anyway and restructure after this party for some reason, the Toys are scrapped for some reason, and the Originals are brought back for some reason, and the animatronic's ability to walk during operation hours is stopped for some reason.
FNaF1: No changes.
Between FNaF1 and FNaF3: No changes, but now we know that Purple Guy was shoved into a suit by FIVE SHITTY-ASS BASTARD KIDDIES. Just a reminder, Purple Guy's son became a vegetable because these kids shoved his face into a lifeless animatronic, and Purple Guy was killed because these kids maneuvered him into hiding in a lifeless animatronic suit. They probably think this is poetic.
FNaF3: Also no changes, except that you helped FIVE SHITTY-ASS BASTARD KIDDIES go to heaven.
Yeah, fuck this game.