Which option of updating iPhone is better?

1. Updating iPhone 5 over the air using Wi-Fi.

or

2. Updating iPhone 5 through iTunes.

Is there any difference in terms of performance, bugs, security, etc?

No they're the same

Over Wi-Fi itunes causes problems and errors

Yes there's a difference if you plan to jailbreak. As ota(over the air) causes problems when jailbreaking. You should always try to update using iTunes as it always seems like the better choice. At the same time it also creates a backup just in case.