It helps to think of the archivist as a divine wizard
That’s what he is, with a “prayerbook” instead of a “spellbook” but they work the same way.
Here, I’ll go through the two of them side-by-side to show you. Note that in all cases, when I say “wizard,” I am ignoring the Specialist option for wizards; the wizard in each example is a “generalist.”
Spells per day
A wizard may prepare a number of spells of each level as listed in their Spells per Day table, as well as additional spells for having a high Intelligence score.
An archivist works the same way, except the bonus spells are for having a high Wisdom score rather than Intelligence score. This change is important because everything else an archivist does is based on Intelligence; this split between Intelligence and Wisdom is known as dual-ability dependence, and is a pretty big deal (for example, a wizard could have a very low Wisdom score, relying on his strong Will save to counteract that, but an archivist needs Wisdom for the bonus spells).
Bonus spells are a mechanic common to all spellcasters; the only thing that changes is the ability score used. In all cases, these are only spell slots, not spells known. The amount of bonus spells is given in Table – Ability Modifiers and Bonus Spells.
Neither archivist nor wizard knows spells the way a sorcerer does; they require an external aid, namely the prayerbook or spellbook. These books may contain many, many spells, but the archivist or wizard must prepare his spells per day (as determined above) ahead of time, so they only have access to a limited subset of the spells they “know” (that is, have in their prayerbook or spellbook).
Neither the archivist nor the wizard has a table indicating their spells known, because they may add as many spells as they can find/afford/fit into their prayerbooks/spellbooks. The table you see is for Spells per Day only.
Both archivist and wizard require that their Intelligence score (not bonus) be at least 10 + the spell’s level to add it to their prayerbook/spellbook, and they must be a high enough level to cast it in order to prepare it.
Other divine spellcasters, like cleric or druid, also must prepare their spells ahead of time, but need no book, since their spells come from their deity or divine forces. In a sense, the gods or powers that such spellcasters pray to form a gigantic “spellbook” for these classes.
A wizard starts play with a spellbook that has every cantrip from the Sor/Wiz list in it, as well as three 1st-level Sor/Wiz spells, plus an additional 1st-level Sor/Wiz spell per Intelligence bonus.
An archivist starts play with a prayerbook that has every orison from the Cleric list in it, as well as three 1st-level Cleric spells, plus an additional 1st-level Cleric spell per Intelligence bonus.
Free spells on level-up
A wizard gets to add two Sor/Wiz spells of up to the highest level he can cast to his spellbook every level.
An archivist gets to add two Cleric spells of up to the highest level he can cast to his prayerbook every level.
Here’s the tricky bit. Both archivists and wizards can add more spells to their prayerbook/spellbook. This costs money, but ultimately not that much money. They have to find the spells to copy them into their books, but this also means they can take advantage of a lot of spells they come across.
Wizards are fairly straight-forward. The spell must come from the Sor/Wiz list, and it must be copied from an arcane scroll or spellbook. For examples, a wizard could copy into his spellbook a scroll of protection from evil that was written by a sorcerer (i.e. arcane scroll, spell is on Sor/Wiz list), but not a scroll of protection from evil that was written by a cleric (on Sor/Wiz list, but not arcane), nor a scroll of cure light wounds written by a bard (arcane, but not on Sor/Wiz list).
Archivists are similar, with one major difference. Where a wizard must copy an arcane scroll or spellbook, an archivist must copy a divine scroll or prayerbook. However, where a wizard can only copy spells that are on the Sor/Wiz list, the archivist doesn’t care what spell list it is on. As long as the scroll or prayerbook is divine, the archivist may copy it, prepare it, and cast it (assuming they can cast spells of that level).
Balance and design
You seem to be a bit confused why things are the way they are, and you questioned the balance of things at least once, so I want to explain what’s going on.
To begin, the archivist is a phenomenally powerful class. It is one of the top five most powerful classes in the game, in fact. The wizard is as well, which is hopefully not surprising at this point since the two are nearly identical. The others are the artificer (Eberron Campaign Setting), cleric, and druid.
I’m going to ignore the oddball (the artificer); for the other four, all are considered to be in the top “tier” because they get extremely powerful spellcasting (up to 9th-level spells, the best there are, and from very good spell lists), and they can change which spells they have every day. That flexibility is fundamentally incredible, and it is that fact alone that separates these spellcasters from the next tier, which includes for example the sorcerer (literally the same list as the wizard, but can’t change spells so easily).
So yes, these classes are incredibly powerful. You’ll notice that three are from the original Player’s Handbook – Wizards simply underestimated what they could do, overestimated what other classes could do, and made mistakes making them.
The archivist was written much later, but was based on the cleric and wizard, so it inherited their power. Since the cleric could already access the entire Cleric spell list, the archivist needed something extra to justify the prayerbook: that extra something was the ability to scribe any divine spells, not just Cleric spells. The archivist also gets pretty nice class features, so it splits between Int/Wis instead of being pure Int or pure Wis. That’s how it got to be the way it is.