You're right; during His final days of public ministry Jesus didn't hide from those who opposed Him -- not at all. In fact, every day He preached to the crowds that had gathered to celebrate Passover, teaching them about the Kingdom of God and urging them to repent of their sins.
His enemies couldn't seize Him while the crowds were present because the people were impressed with Jesus' teaching, and the authorities were afraid they might cause a riot by arresting Him. The Bible says, "They looked for a way to arrest him, but they were afraid of the crowd because the people held that he was a prophet.... (so) they plotted to arrest Jesus in some sly way" (Matthew 21:46; 26:4).
At night, Jesus left the crowds behind, however, and quietly went with His disciples to a private place outside the city. Remember: In those days, there were no streetlights, nor was there an easy way for people to communicate from one village to the next. If Jesus' enemies were to arrest Him, they first had to find Him -- and in order to do this, they needed someone to tell them where He was staying. They were delighted, therefore, when Judas agreed to betray Jesus by leading them to Him.
No life has ever been sadder or more tragic than that of Judas. He had witnessed Jesus' miracles and heard His teaching, yet he still betrayed Him for 30 silver coins. Don't let greed, or anything else, keep you from committing your life to Jesus, for He alone is our Savior.