The starter gear only engages the flywheel when it's turning over the engine. The solenoid makes the gear move toward the flywheel teeth when you start the truck.
Another bit, when your battery is low, many times all you hear is that solenoid click but no juice to turn the motor. Also, contacts in Toyota starters sometimes go bad so all you hear is that click. I hate doing the starter in my truck... I have to do mine again
One way to inspect your flywheel teeth is to inspect them when your starter is out. Turn the engine over by hand and check for broken teeth. I don't know what kind of damage happened to your starter but if it still starts the truck ok then it's probably not too bad. If it starts making a terrible grinding noise when you try to start the truck, then you know theres a problem.