The node is the ruler, but it rules only itself. It needs to act responsibly to maintain its connection to other nodes in the network. It relies on the network to get all historical data once it connects and to communicate with other nodes.
Valide data arrives to the node and is added to a chain roughly every 10 minutes. Every time a block of data is added to the chain, it carries in itself the identity of the previous block. The history of all bitcoin transactions is encoded in this blockchain.
To be able to write the next block in the chain, a node needs to mine a valid block: aggregate a number of transactions from the mempool (list of transactions waiting to be settled on the blockchian), create a block header with the merkle-root of the transactions IDs merkle-tree (prevents any future changes to transaction data), previous block id (prevents future changes to the previous block data), date, version, difficulty target, and the nonce (number used once). A program iterates on the nonce as fast as possible and runs the header twice through 1 hashing function (a program that given any input, outputs a fixed length hash, that changes if just 1 character changes in the input). If the output is smaller than the difficulty target, the network will accept the block and everyone will add it to the chain.
The difficulty adjustment mechanism maintains the time it takes to find a valid block around 10 minutes by increasing or decreasing the target. If a lot of computers run the mining program, and find blocks very fast, at block 2016 of every cycle, each node looks back in history and adds-up how long it took them to be found. If more than 2 weeks, the difficulty decreases and vice-versa.