Sharks can come close to shore at night, which is why night swimming in areas known for sharks is not recommended. They might be attracted to fish and other marine life close to the shore.