It means that if you have enough determination anything is possible. Example:
John was lost in the jungle and thought he could never get back home, but thinking about his family gave him the strength to climb a tall tree and see a way out, which just goes to show that when there is a will there is a way.