What I think the short answer is: where he walked, miracles followed.
Throughout the Gospels and Acts, there are numerous accounts of miraculous healings performed by Jesus and the apostles. News tends to spread quickly when supernatural miracles occur. These acts demonstrated the divine power working through them to bring about physical and spiritual restoration. The people witnessing these miracles would have likely attributed such power to the individuals themselves and anything associated with them.
The act of laying the sick in the path of Peter's shadow was an expression of faith in his authority and in the power of God working through him.
I think we can also take into account the cultural context. For example, ancient Greek and Roman religions were polytheistic, with numerous gods and goddesses who were believed to influence various aspects of life.
gotquestions says:
People wanted to believe there was something special about Peter, and
they began seeking proximity to him in hopes of having some power pass
over them. It wasn’t the first (or last) time that people sought a
special blessing through a physical object. The paralyzed man in John
5 believed that water in a certain pool could heal his lameness. Some
Ephesians in Acts 19 believed that healing power was concentrated in
articles of Paul’s clothing (cf. Matthew 9:21). Some people today put
their trust in handkerchiefs that have been “prayed over,” in relics
of the saints, or in holy water.
In Acts 3 God’s power was demonstrated through Peter and John when a
lame man was healed. The news spread quickly, and a great crowd
gathered in Solomon’s Colonnade, full of amazement. Peter spoke to the
crowd, correcting their assumption that he and John had special power
in themselves: “Men of Israel, why does this surprise you? Why do you
stare at us as if by our own power or godliness we had made this man
walk?” (verse 12). The apostle then goes on to point the crowd to
Jesus: “It is Jesus’ name and the faith that comes through him that
has given this complete healing to him, as you can all see” (verse
16).
The scripture recounts that it was the people themselves who brought out the sick individuals. Peter did not instruct them to do so; rather, they acted of their own volition. The question arises: what prompted them to take such action? What unusual events might have occurred to foster the belief among these individuals that Peter's mere shadow possessed healing powers?
It was because: where he walked, miracles followed. As we see in the verses prior to this: Acts 5:12-14
12 And through the hands of the apostles many signs and wonders were
done among the people. And they were all with one accord in Solomon’s
Porch. 13 Yet none of the rest dared join them, but the people
esteemed them highly. 14 And believers were increasingly added to the
Lord, multitudes of both men and women,
(Also see: Acts 3:1-10, Acts 5:1-11)